@techee you can try deleting the current line yourself in the current Geany since it is already assigned a keyboard shortcut by default. note that the cursor already moves to the start anyway, so updating the last X is a natural thing to do. and actually there is one command that it eventually runs which happens to update the last X.

I'm not questioning the "select line" case - as I said, for that feature it makes sense. Notice, however, that your implementation sets "last X" to 0 for all other uses of the functions you modified and this is not OK. Your patch should only affect the "select line" case and not other cases. IMO, to achieve this,

https://github.com/geany/geany/blob/3eeb361b6a2e29cdbc473cf4dc277cbe5b23283b/src/keybindings.c#L2511-L2512

should be replaced with

if (doc != NULL)
{
    editor_select_lines(doc->editor, FALSE);
    SSM(doc->editor->sci, SCI_CHOOSECARETX, 0, 0);
}

(completely untested). Then it's guaranteed that the change won't have some negative impact on other Geany features.

about the updating of last X for every active command-based selection change, I think it's acceptable because it is natural. the only reason to have a last X in the first place is when you are cursoring up and down using the arrow keys (or extending the selection) and you don't want your caret point location to keep changing randomly. the last X is not even something the user is actively aware of and keeps track of, so I don't consider it a major change. there is also nothing inefficient about updating the last X as it is just copying an integer so there is no reason not to.

The functions from sciwrappers.c/h aren't the right place to do that. As the name of the file suggests, these are just thin wrappers around Scintilla which are meant to offer a nicer alternative to the Scintilla API but nothing more. These functions are exposed to plugins and modifying them means breaking Geany API.

No, it's not just about line selection, it's also word selection, which is w by default. you can try it out and see how unnatural it feels right now.

If there are more use cases for that, they should be addressed on a case by case basis but not by modifying scintilla wrappers universally.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/4093/c2567080527@github.com>