Strange behavior of some shortcuts in the editor

43 views
Skip to first unread message

gar

unread,
Jul 14, 2019, 4:57:10 AM7/14/19
to leo-editor
I'm surprising every time I use something like ctrl-right or other shortcuts that are for text selection or cursor movements.
Cursor may jump over punctuation marks, ), etc, may even jump thru several lines (if current line ends with bracket and lines below are empty).
This is very odd and uncommon. Where can I change that for something more Notepad-like?

Matt Wilkie

unread,
Jul 14, 2019, 8:35:09 PM7/14/19
to leo-editor
I'm surprising every time I use something like ctrl-right or other shortcuts that are for text selection or cursor movements.
Cursor may jump over punctuation marks, ), etc, may even jump thru several lines (if current line ends with bracket and lines below are empty).
This is very odd and uncommon. Where can I change that for something more Notepad-like?

So you're not seeing the same as this: https://leoeditor.com/cheatsheet.html#moving-the-cursor ?

`Alt-X, show-bindings` will print the existing key bindings to Tabs panel.

`.../leo/config/leoSettings.leo#@settings-->Keyboard shortcuts` defines the bindings. Copy the node tree (or portions of) to myLeoSettings.leo to customize them.  (Disclaimer: I haven't really worked with changing keybindings.)

-matt





Edward K. Ream

unread,
Jul 14, 2019, 8:55:19 PM7/14/19
to leo-editor
On Sun, Jul 14, 2019 at 3:57 AM gar <gar...@gmail.com> wrote:
I'm surprising every time I use something like ctrl-right or other shortcuts that are for text selection or cursor movements.
Cursor may jump over punctuation marks, ), etc, may even jump thru several lines (if current line ends with bracket and lines below are empty).

As Matt says, your real complaint is with the commands bound to Ctrl-Left/Right Arrows, that is, the  back-word and forward-word commands.

See the nodes:
- ec.forward*/ExtendSelection
- ec.backward*/ExtendSelection

Both call ec.moveWordHelper.  This is a complex helper, whose behavior depends on the "smart" kwarg arg.  That is there are also "-smart" variants of the commands.

I have no attachment to the way moveWordHelper presently works.  Feel free to improve it.

Edward
Reply all
Reply to author
Forward
0 new messages