ctrlf icon indicating copy to clipboard operation
ctrlf copied to clipboard

hitting enter during search doesn't keep the search focus center

Open rileyrg opened this issue 3 years ago • 3 comments

I have the auto-center option on so when I hit C-s the next search match is in the centre of the screen. It would be VERY nice (and consistent) if when I hit enter to exit search and cursor around the text I just located it stayed in the centre,. As it is, the buffer jumps - very inconvenient when trying to do a screencast.

rileyrg avatar Mar 09 '21 22:03 rileyrg

Yes, I agree: the desired behavior you describe is what should happen. It sounds like there is a bug that prevents this from being the case currently. The scroll position should remain unchanged when you exit a search, unless you've aborted it (in which case it should scroll back to your initial starting position). If you disable ctrlf-auto-recenter, does the scroll position remain fixed when you exit a search? In other words, does this bug occur only with ctrlf-auto-recenter enabled?

raxod502 avatar Mar 21 '21 19:03 raxod502

Sorry for the late reply. It happens with or without auto-recenter. I'm not aware of any hack I have which could cause this.

rileyrg avatar Apr 02 '21 05:04 rileyrg

Just posted the same issue in #90; looks like a mechanism was already in place to "fix" this misbehavior on mini-buffer exit (by restoring window-start), but never actually used. Putting it in place ctrlf--finalize fixed it for me.

jdtsmith avatar Apr 10 '21 21:04 jdtsmith