Scintilla does different things when using SCI_WORDRIGHT, SCI_WORDLEFT, SCI_WORDRIGHTEND and SCI_WORDLEFTEND than what we want for commands like "w", "b", "W", "B", "e", "E", etc. For instance, for
ident1 = id|ent2+ident3;
where | represents the cursor, SCI_WORDRIGHT does
ident1 = ident2+|ident3;
while Vim's "w" does
ident1 = ident2|+ident3;
For this reason we have to reimplement all the word navigation by ourselves to better emulate the behavior of Vim. This patch tries to do that.
Should fix #909 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/919
-- Commit Summary --
* vimode: Don't use word navigation from Scintilla
-- File Changes --
M vimode/src/cmds/motion.c (288)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/919.patch https://github.com/geany/geany-plugins/pull/919.diff
This works well!, I did find one very specific issue though, the cursor will no go back (b) to the very first character of the very first line.
Should be fixed now. I've also rewritten the patch to make it more maintainable and moved the code to a separate file.
Seems good to me, thanks for doing this by the way.
Merged #919 into master.
github-comments@lists.geany.org