Skip to content

dw and cw are buggy #13

@XManticore

Description

@XManticore

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions