A quick shortcut I am used to working is hitting ctrl and the left arrow a few times, and I end up at the start of the line I am editing. This allows me to do things like select a few lines and group-indent them, without having to use the mouse or hit too many keys.
However, in Geany doing this will never get you to the start of a line, as it will jump up a line instead.
This seems to be the intended behavior, see https://www.geany.org/manual/current/index.html#keyboard-commands.
You can use the HOME key to get to the start of the line quickly.
Thanks for the tip, HOME will work for me. But I still think the bug is valid, as people get so used to their keystrokes, and I don't see any reason to not make this one consistent with what other systems do. It seems line-break is considered part of a "contiguous spaces" virtual keyword, so we'd just need to tweak that to treat line-breaks as a separate virtual keyword. (I just made up the terminology, but I think it's clear what I mean).
Let's see what the core developers say.
I guess simply changing it is not a good option because other people might just like the current behavior more than what other editors do (might be but I don't know). So if someone would change the behavior IMHO it should have a config option to enable it first.
Ctrl-left and ctrl-right move by word, to the start or end of the word respectively.
So logically there is no reason for the cursor to stop at the start of a line unless its the start or end of a word. There is no logical definition of a "word" that makes a line start _both_ a start and an end of a word.
Its unfortunate that the definition is not prefect for your use-case, but it meets its intended use-case. Being identical to other IDEs is not in the definition, Eclipse for example stops at underscores in identifiers which is a pain.
TL;DR details:
Words are defined by Scintilla (rather poorly IMHO) [here](https://www.scintilla.org/ScintillaDoc.html#Words).
To perhaps explain it better (as I understand it), there are four categories of characters:
- ASCII whitespace and Unicode whitespace - ASCII punctuation and Unicode punctuation - ASCII line ends and Unicode line ends - the rest (the whole Unicode shebang)
and word moves move to the start/end of the next contiguous sequence of characters in the same category but skipping intervening whitespace category characters.
That somewhat artificial (but easy to implement) definition turns out to be very useful in code since the categories often align with syntactic entities ("punctuation" with operators, "the rest" with identifiers and keywords etc). But that means the line ends are considered words, so ctrl-left will go to the start of the line end (ie the end of the preceding line) and ctrl-right will move to the end of the line end (ie the start of the next line).
Scintilla allows ASCII characters to be moved between categories, but Unicode characters are always defined by their Unicode category definition.
Geany defines the whitespace category in `filetypes.common` (potentially overridden by specific filetypes, but rarely is) in `[settings]whitespace_chars` and includes the ASCII punctuation so a "word" is closer to human "word" or computer "identifier". Adding newline (\n) to that removes it from the line ends list, so now neither ctrl-left/right stop there :grin:.
github-comments@lists.geany.org