> @techee I just reread your objection again and I think you misunderstood what 
> SCI_CHOOSECARETX does.

I think I understand very well what it does.

But you don't seem to understand that if you want to modify the behavior of 
certain actions where updating SCI_CHOOSECARETX makes sense (e.g. selecting the 
current line), you should modify those actions _only_ and not to do it 
universally in scintilla wrappers for SCI_SETSELECTIONSTART, 
SCI_SETSELECTIONEND, etc. - these functions are exposed to plugins and plugins 
expect these functions to do exactly the same thing as what Scintilla does - 
nothing extra.

Consider for instance a plugin wants to implement a "copy current line to 
clipboard" feature and decides to do it this way:
1. Remembers current caret position
2. Uses `sci_set_selection_start()` and `sci_set_selection_end()` to make a 
selection of the current line
3. Copies the selection to clipboard
4. Clears the selection
5. Restores the caret position from (1)

To the user, after performing such an operation, it appears as if no change in 
the editor was made - the caret is at the same position, just the line is 
copied to the clipboard. Yet, if what you propose with your patch is 
implemented, SCI_CHOOSECARETX would be set to 0 which is something the user 
doesn't expect. And the plugin author doesn't expect this neither.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4093#issuecomment-2585474563
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/4093/c2585474...@github.com>

Reply via email to