Do not slurp text when switching from find to replace

Tim Etler fa 7 anys • actualitzat fa 7 anys 0
I will frequently press ctrl+f to open find and write a regex, then decide that I want to do a replace with it. When I press ctrl+h to switch modes, it slurps up the current selection, which is whatever my regex was selecting, when I wanted to preserve my regex.

This could be fixed by not slurping when switching between modes, and only slurping when ctrl+f/ctrl+h have been pressed for the first time, or a second time in the same mode.

Alternatively maybe the editor could distinguish if the selection is selected due to the result of a regex, and not slurp when transitioning modes in that case.