This is due to an upstream bug in Scintilla: [Scintilla / Bugs / #2488 SCI_SETSELECTIONNSTART and END set anchor and caret instead](https://sourceforge.net/p/scintilla/bugs/2488/) (I thought I'd open this to track the issue) Originating discussion: [How can I collapse selections to the start? · orbitalquark/textadept · Discussion #633](https://github.com/orbitalquark/textadept/discussions/633)