scopatz / xo

exofrills text editor
http://exofrills.org/
Do What The F*ck You Want To Public License
98 stars 16 forks source link

Ctrl+Right won't jump to the end of a line #24

Closed catb0t closed 5 years ago

catb0t commented 5 years ago

But Ctrl+Left to go left 1 word does go left 1 word like it should. Not sure I can fix this but I can try.

https://github.com/scopatz/xo/blob/febf634fb6f2988f22aed987301c1c349e4b2a98/xo.py#L856-L862

catb0t commented 5 years ago

Oh, I think the bug is that condition,

re_word = RE_WORD if k == "meta right" else RE_NOT_WORD  

"meta right" goes 1 word to the right but "ctrl right" goes right by 1 NOT_WORD, which is the opposite of the "meta left" / "ctrl left" behaviour.

Is that intentional?

catb0t commented 5 years ago

I made a mistake -- Ctrl+Right only fails to go 1 word right, when doing so would put the cursor beyond the end of the line (i.e a line ends with a word and no trailing whitespace). So, it is confused with Meta+Right