User forums > Using Code::Blocks
Bad user experience of the replace dialog
ollydbg:
See the first screen shot below:
I want to replace the text "editor", so I double click on the "editor", good, the text is automatically select when I open the "replace dialog".
Then I press the button "Replace" to start the replacement process.
See the second screen shot.
To bad :(, not the text in current caret position is a candidate, but the next occurrence of "editor" was firstly prompt to be replaced.
What I expect the good way is:
The replace precess should start from the current caret position, not the next occurrence of the search text.
Jenna:
If you double-clicked the word, the cursor position is most likely somewhere in the middle of the word, so the behaviour is correct (even if the user might expect the actual selected word to be the first one that is replaced).
To change this there are two possibilities: always start replacing/searching at the beginning of a selection (if any) or set the cursor-position to the beginning of the selection and start replacing/searching afterwards.
Both would have the same effect, but if "Origin" is "from cursor" I guess many users would expect to start there and not to change the position automatically.
ollydbg:
The related code was in
sdk\editormanager.cpp line 1634
--- Code: ---int EditorManager::ReplaceInFiles(cbFindReplaceData* data)
--- End code ---
But this function was too long, and I can't understand the whole logic. :(
Jenna:
--- Quote from: ollydbg on November 23, 2009, 02:57:13 pm ---But this function was too long, and I can't understand the whole logic. :(
--- End quote ---
The logic is quite simple: if "Origin" is "from cursor", C::B searches from cursor-position, but if you select a word by double-click scintilla places the cursor at the end of the selection, so it finds the next occurrence first.
ollydbg:
Thanks.
Is it possible to change the start position of the search. It seems this function control the start position.
sdk\editormanager.cpp line 1287
--- Code: ---void EditorManager::CalculateFindReplaceStartEnd(cbStyledTextCtrl* control, cbFindReplaceData* data, bool replace)
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version