Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Do not clear new selection on exit from Edit mode

Open ProgerXP opened this issue 5 years ago • 2 comments
trafficstars

Document:

|aa aa
aa
  1. Press F3, enter aa
  2. Press Ctrl+backtick to enter line-wise Edit mode:
[aa] [aa]
aa
  1. Optionally type something:
[xx] [xx]
aa
  1. 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]

ProgerXP avatar Sep 26 '20 12:09 ProgerXP

Fixed.

cshnik avatar Oct 03 '20 00:10 cshnik

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:

  1. Document = |aa\naa
  2. Press Ctrl+Tab
  3. Press Left, Shift+Right ([a]a\naa), Ctrl+Tab
  4. 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.

ProgerXP avatar Sep 01 '21 19:09 ProgerXP

Fixed. PS All other n2e_SelectionEditStop-calls are required.

cshnik avatar Aug 24 '22 17:08 cshnik