Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimode: Don't use word navigation from Scintilla #919

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

techee
Copy link
Member

@techee techee commented Oct 5, 2019

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

@techee techee mentioned this pull request Oct 5, 2019
@alukreis
Copy link

alukreis commented Oct 5, 2019

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.

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", "ge", "gE". 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.
@techee
Copy link
Member Author

techee commented Oct 7, 2019

Should be fixed now. I've also rewritten the patch to make it more maintainable and moved the code to a separate file.

@alukreis
Copy link

alukreis commented Oct 8, 2019

Seems good to me, thanks for doing this by the way.

@frlan frlan merged commit c68c425 into geany:master Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dw/cw incorrect behaviour
3 participants