ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
375 stars 52 forks source link

New Line commands improperly update Undo #97

Open ProgerXP opened 7 years ago

ProgerXP commented 7 years ago

When I do undo/redo after/before New Line commands - the cursor must be positioned exactly where it was originally. But it's often shifted by one symbol. This happens at least for New Line Above. I found this while testing #94.

cshnik commented 7 years ago

This is a general Scintilla's problem related to how Undo-history works, actually it never saves/restores cursor position. Please follow next steps using common editor manipulations:

  1. Insert next text:

    |1
    2
    3

  2. Remove first line (double press on Del):

    |2
    3

  3. Press Ctrl+Z to undo the changes and you will get:

    1 |2 3

I've already wrote somewhere that Scintilla has no proper cursor position adjustment when applying undo/redo commands. This is a general problem and will require some time to fix.

ProgerXP commented 7 years ago

I see. Let's postpone this task.