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

dw/cw incorrect behaviour #909

Closed
alukreis opened this issue Sep 25, 2019 · 3 comments · Fixed by #919
Closed

dw/cw incorrect behaviour #909

alukreis opened this issue Sep 25, 2019 · 3 comments · Fixed by #919
Assignees

Comments

@alukreis
Copy link

Hi,

I use vim quite a lot and noticed a few incorrect behaviours, dw and cw being one.

I'll denote the cursor as a double quote ("), before a letter means it's on that letter.
In geany vimode the following line int the function block:

void foo(BarClass *pointer) { std::"cout << pointer->bar_func() << std::endl; }

pressing dw or cw would yield:

void foo(BarClass *pointer) { std::"pointer->bar_func() << std::endl; }

in vim either would yield: (it deletes up to some special characters, not the next word)

void foo(BarClass *pointer) { std::"<< pointer->bar_func() << std::endl; }

Another example, start again here, with cursor before pointer:

void foo(BarClass *pointer) { std::cout << "pointer->bar_func() << std::endl; }

geany yields:

void foo(BarClass *pointer) { std::cout << "bar_func() << std::endl; }

vim yields:

void foo(BarClass *pointer) { std::cout << "->bar_func() << std::endl; }

Geany vimode also treats dw and cw the same in all cases (apart from dw staying in normal mode and cw entering insert mode, which is correct). In the below example, cursor on B of BarClass:

void foo("BarClass *pointer) { std::cout << pointer->bar_func() << std::endl; }

for both, geany would yield:

void foo("pointer) { std::cout << pointer->bar_func() << std::endl; }

dw in vim would yield: (asterisk remains)

void foo("*pointer) { std::cout << pointer->bar_func() << std::endl; }

cw would yield: (extra space, so when typing new word, space is already there)

void foo(" *pointer) { std::cout << pointer->bar_func() << std::endl; }

It's worth noting that the special character seem to be specific, so for example underscore is treated as part of the word in vim:

void foo(BarClass *pointer) { std::cout << pointer->"bar_func() << std::endl; }

dw or cw in vim becomes: (deletes underscore too)

void foo(BarClass *pointer) { std::cout << pointer->"() << std::endl; }

These seem minor but it is much more often the case that the Alphanum characters and underscore are the ones that the user is considering the 'word' and wants to delete, having to re-type the operators such as '<<' or '-' or '>' etc etc is not the intention.

If it is likely that these changes will get integrated into vimode I would like to offer my services since I work with c and c++ and vim, I think I could get it working just right. Am I ok to dig in?

Thanks,

Lukas

@techee
Copy link
Member

techee commented Oct 5, 2019

@alukreis Would you try #919 ? I had to reimplement all the word navigation and not to use the Scintilla one which I used previously and which obviously doesn't do the right thing. Hopefully the patch fixes the issue.

@alukreis
Copy link
Author

alukreis commented Oct 5, 2019

I'll give it a go.

@alukreis
Copy link
Author

alukreis commented Oct 8, 2019

#919 looks good to me, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants