[Geany-Devel] How to programmatically de-select text
austin.green at xxxxx
Wed Aug 28 10:38:24 UTC 2019
> > Trying to programmatically cancel a text selection. There are functions that will probably do it, e.g. sci_set_selection, but bearing in mind the restriction on changing the API, those functions are not callable from my code.
> > Surely I'm missing something obvious here? I do hope so! :)
> Scintilla docs say "If the anchor and the current position are the
> same, there is no selected text." so probably set selection start and
> end both to current position.
Yes, that's what I tried first. It only appears to have no selection -- as soon as I move the caret, it starts selecting again (even without the shift key!) So appears to have gone into a strange extend-selection-just-by-moving mode. I can make it return to normal by hitting ESC and then an arrow key, or by again setting the selection start and end points the to the same position. Weird or what?
More information about the Devel