[Geany-devel] Logical vs. display line movements -- answering #3041948

Colomban Wendling lists.ban at xxxxx
Tue Aug 28 18:02:48 UTC 2012

Hi guys,

I took a look at #3041948 [1] and did a prototype patch (attached) to
fix it.  Basically it's about the behavior of the Home and End keys
regarding wrapped lines.  We have configurable keybindings already, but
they don't really make the editor display-line-friendly since they don't
change the behavior of <Shift>Home and <Shift>End, aka selection extension.

Instead of repeating me, I'll quote the attached patch:

> Add setting to make Home and End keys navigate in display coordinates
> This cannot really be mapped using the keybinding because holding
> Shift together with Home or End is expected to behave exactly the
> same as without it but extending the selection;  which is tricky to
> get using configurable bindings.
> For this setting to behave correctly, the Home and End keys should
> obviously not be bound to any action, so the default bidings of Home
> and End should most probably be removed.  Maybe the "Go to [display]
> line start/end" actions should be removed altogether now a global
> setting can be used to choose one behavior or the other;  but they can
> also be kept but unmapped by default, which would allow a user to map
> another key to this action (like <Ctrl>A and <Ctrl>E to emulate a
> Bash/Emacs-like behavior).
> Closes #3041948.

So, what do you think?  Is this a correct way to fix this, or should we
rather either add (4) separate configurable bindings for extending the
selection to the start/end?  Or should we add a trick to extend
selection when <Shift> is pressed together with one of the current
bindings (that's probably not a good idea in the (unlikely) case one
binds one of these actions to <Shift>Something)?

Also, should we remove the bidings if we add that?  Or should be just
not bind them by default?

What about backward compatibility?

Looking forward to read you :)


PS: This uses 2 new Scintilla (not yet released) commands to respect
"smart home key" feature when dealing with display lines, so you'll need
a patch for that too -- attached.
PPS: 3rd patch is to make "move to start of display line" command
respect the "smart home" feature, too.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-setting-to-make-Home-and-End-keys-navigate-in-di.patch
Type: text/x-patch
Size: 11473 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20120828/cbeb7bc1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Backport-Scintilla-patches-adding-SCI_VCHOMEDISPLAY-.patch
Type: text/x-patch
Size: 3928 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20120828/cbeb7bc1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Make-Go-do-start-of-display-line-respect-smart-home-.patch
Type: text/x-patch
Size: 917 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20120828/cbeb7bc1/attachment-0002.bin>

More information about the Devel mailing list