Index: src/sdk/replacedlg.cpp
===================================================================
--- src/sdk/replacedlg.cpp (revision 4010)
+++ src/sdk/replacedlg.cpp (working copy)
@@ -73,7 +73,7 @@
XRCCTRL(*this, "rbDirection", wxRadioBox)->Enable(!XRCCTRL(*this, "chkRegEx1", wxCheckBox)->GetValue()); // if regex, only forward searches
XRCCTRL(*this, "rbOrigin", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/origin"), 0));
XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(hasSelection);
- XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
+ //XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
// special key, uses same config for both find & replace options
XRCCTRL(*this, "chkAutoWrapSearch", wxCheckBox)->SetValue(cfg->ReadBool(_T("/find_options/auto_wrap_search"), true));
Index: src/sdk/finddlg.cpp
===================================================================
--- src/sdk/finddlg.cpp (revision 4010)
+++ src/sdk/finddlg.cpp (working copy)
@@ -89,7 +89,7 @@
XRCCTRL(*this, "rbDirection", wxRadioBox)->Enable(!XRCCTRL(*this, "chkRegEx1", wxCheckBox)->GetValue()); // if regex, only forward searches
XRCCTRL(*this, "rbOrigin", wxRadioBox)->SetSelection(cfg->ReadInt(CONF_GROUP _T("/origin"), 0));
XRCCTRL(*this, "rbScope1", wxRadioBox)->SetSelection(hasSelection);
- XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
+// XRCCTRL(*this, "rbScope1", wxRadioBox)->Enable(hasSelection);
// find in files options
XRCCTRL(*this, "cmbFind2", wxComboBox)->SetValue(initial);
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp (revision 4010)
+++ src/sdk/editormanager.cpp (working copy)
@@ -1222,14 +1222,9 @@
int wordEnd = control->WordEndPosition(control->GetCurrentPos(), true);
wxString wordAtCursor = control->GetTextRange(wordStart, wordEnd);
phraseAtCursor = control->GetSelectedText();
- // if selected text is the last searched text, don't suggest "search in selection"
- if ((m_LastFindReplaceData &&
- !phraseAtCursor.IsEmpty() &&
- phraseAtCursor == m_LastFindReplaceData->findText)
- || phraseAtCursor == wordAtCursor)
- {
+ // if selected text is part of a single line, don't suggest "search in selection"
+ if (control->LineFromPosition(control->GetSelectionStart())
+ == control->LineFromPosition(control->GetSelectionEnd()))
hasSelection = false;
- }
if ( phraseAtCursor.IsEmpty())
phraseAtCursor = wordAtCursor;
History
I realize I forgot to update the replace dialog as well...
updated patch (change to replace dialog as well)
another update. this one doesn't rely on line endings being \r and/or \n
Similar to my patch
Bug #10992">http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2010&group_id=5358
it was rejected by biplab, because he made patch for this bug by himself... and after some time he reverted it :)
I submitted this one because patch 2010 broke "uses selected text". this patch does not break this feature. it also gives you access to global scope irrespective of what has been selected.
@pauliusz,
That time I found that the fix I prepared was good enough. But later when it broke other parts, I reverted it. I'm sorry as I didn't give any explanation on why your patch was rejected. I appreciate your hard work and I can understand your feeling when your patch was rejected without an explanation. :)
@dmoore
Give me couple of days to test it. I wrote in forum that it created a bug. Let me make sure that this patch is not the reason behind it.
@biplab,
Don't worry about my feelings :) I know you are working very hard on CB. Also I think dmoore patch is better then mine (haven't tested, only my intuition).
Patch applied. Thanks for the patch.