orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
617 stars 39 forks source link

Undo deletion & caret position #523

Open neumond opened 2 months ago

neumond commented 2 months ago

When I delete some text using my custom line delete command or delete a selection of text leaving caret at the beginning of the selection, then undo, caret moves to the end of deleted text. I expect it to restore caret position along with text. Screenshot from 2024-04-15 18-56-11

neumond commented 2 months ago

I like the editor, it's the thing I've always wanted: simple optimized grid of text, first class GUI, non-esoteric scripting language, conventional set of hotkeys without modes and ability to use non-file buffers. Thank you for your work!

orbitalquark commented 2 months ago

Scintilla (the editor component Textadept uses) does not restore caret position as part of an "undo" operation. There has been some discussion on the mailing list regarding this, but nothing definitive came of it: https://groups.google.com/g/scintilla-interest/c/CB20mc50kt0/m/1PT0oRJ4AAAJ

At this time, there's no robust way to do what you are expecting, even though it would be nice to have :(

By the way, thank you for the detailed report!