FarManager
FarManager copied to clipboard
Find the Pattern under Caret with Reverse Search
Description of the new feature or improvement
At some point between 3.0.5720.0 and now, the behavior of Internal Editor's reverse search changes slightly. In the olden days, if I reverse search for abc
with the caret at the line abc
in the position of the b
or c
, the pattern I am at will be found. Now it is skipped, and the previous occurrence, if exists, is found or "Could not find..." dialog is displayed.
I almost started implementing the change but happened to check the behavior of MSVC editor. Not entirely surprisingly, it also skips the pattern under the caret when searches backward. It does make some sense. After all, if I search forward, the pattern under caret is not found, and it feels quite natural. My only problem is that somehow I am fine with this behavior in VS, but expect different behavior from Far. It breaks my workflow. 🙂 Just recently, I was sorting out through a large list of long similar-looking strings and for some time could not understand why I could not find a certain string, even though I've just found it searching forward from the beginning of the file.
What is general opinion about reverting the old behavior?
Proposed technical implementation details (optional)
I can implement this change if people here think it's a good idea.
@MKadaner I am fine with either behavior, as long as:
- it is consistent between the regular search and the regex search (looks like currently it is not)
- next/previous searches do not stuck, regardless of the
Cursor at the end
option.
P.S. I do not remember changing this intentionally. It could be accidental or an attempt to fix #2.
Thank you, @alabuzhev, I'll look at it then. (I did not even remember there was this option. 🙂)
What do you mean "stuck?" The search does not progress on repeated pressing of Shift+F7
/Alt+F7
?
What do you mean "stuck?" The search does not progress on repeated pressing of
Shift+F7
/Alt+F7
?
Yes, and F7 Enter
.
Please assign this issue to me. I am knee deep in search anyway.
What do you mean "stuck?" The search does not progress on repeated pressing of
Shift+F7
/Alt+F7
?Yes, and
F7 Enter
.
IMHO F7 Enter
should not move forward if the caret is at a match already (in a sense that this exact match should me found). And if the Cursor at the end
option is off, then even the caret should not move in this case.
The reason behind my opinion is that once we open a Search/Replace dialog and accept it, we initiate a brand new search that should discard any context from any previous search.
... once we open a Search/Replace dialog and accept it, we initiate a brand new search that should discard any context from any previous search.
I think this is what I did in #651. Could you please double check and create a bug report if it doesn't work this way?
create a bug report if it doesn't work this way?
I did not say it doesn't. I just expressed disagreement with the opinion of alabuzhev on the expected behavior. :) I'm glad you implemented it that way, thank you!
Sorry, I did not presume you said that. It was a roundabout way to ask for more testing. :)