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 and cw are buggy #13

Open
XManticore opened this issue Jul 27, 2011 · 2 comments
Open

dw and cw are buggy #13

XManticore opened this issue Jul 27, 2011 · 2 comments

Comments

@XManticore
Copy link

The delete word and change word command behave strangely, both by themselves and with a multiplier (e.g. d2w)

I'll use square brackets to show the cursor. In Vim, if I have the following text
[d]isplacement.x(); timer.stop();

and press dw, I get the following result:
[.]x(); timer.stop();

which is what you would expect: a word has been deleted and the cursor moves to just after where the word was.
Using text mate, I get this instead:
.x(); []timer.stop();

So the correct word has been deleted, but the cursor goes way after where it should be.

That is annoying enough, but at least the delete works. Unfortunately, when you try to delete two words (d2w), it doesn't work at all – it just moves the cursor. So if we start with our original text
[d]isplacement.x(); timer.stop();

and then press d2w, we just get this
displacement.x[](); timer.stop();

I suspect that in this case, the d command is being ignored and TextMate is just executing 2w, which works as expected.

It's a shame because the ability to do a command followed by an arbitrarily multiplied motion is one of the things that makes vi so efficient.

@philc
Copy link
Owner

philc commented Jul 27, 2011

Hey XManticore, thanks for the bug report. I suspect the behavior in the first case is because of the way TextMate implements word boundaries. I'll see if I can improve that. Regarding d2w, this is not supported at the moment out of oversight. I tend to use this syntax instead, which is supported: "2dw".

@XManticore
Copy link
Author

Thanks for the quick reply. 2dw does work, although with the cursor movement still incorrect as per the first issue. Still, a definite improvement - cheers!

Also, thanks for this package in general. I'm new to Vim, and using it with TextMate is a fantastic way of learning it

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

No branches or pull requests

2 participants