Notepad2e
Notepad2e copied to clipboard
Do not clear new selection on exit from Edit mode
Document:
|aa aa
aa
- Press F3, enter
aa - Press Ctrl+backtick to enter line-wise Edit mode:
[aa] [aa]
aa
- Optionally type something:
[xx] [xx]
aa
- Press F3 without explicitly exiting Edit mode
Result: Edit mode is saved (correct), cursor is moved to next occurrence (correct) but found substring is not selected (incorrect):
xx xx
|aa
Expected:
xx xx
[aa]
Fixed.
c27028f addressed the issue by commiting Edit Mode on Find Next command. This only fixes the described example which is just one case. Please remove implicit commit in that case and others and implement preservation of caret and selection when exiting from Edit Mode via any means (implicitly such as via window deactivation or via Escape/Enter).
As a result, it should be possible to, for example, select [a]a (during an active Edit Mode), press Escape and have [a]a selected. The code should simply not change caret at all when ending Edit Mode.
I also noticed that currently caret is not always put in the end of edit region on exit which might be another bug:
- Document =
|aa\naa - Press Ctrl+Tab
- Press Left, Shift+Right (
[a]a\naa), Ctrl+Tab - Document =
a|a\naa
However, if you press Escape in step 3 then document would be aa|\naa. Why different behaviour depending on which keystroke is used to end Edit Mode? Caret and selection must be kept regardless of how Edit Mode is quit.
Fixed.
PS All other n2e_SelectionEditStop-calls are required.