XVimProject / XVim

Xcode plugin for Vim keybindings
MIT License
5.16k stars 595 forks source link

word movement "w" & "b" vs word character span for commands like dw and cw #24

Closed mike-hoegeman closed 12 years ago

mike-hoegeman commented 12 years ago

word movement "w" & "b" work properly now. but commands like dw & cw are deleting using the same span of characters which is not correct e.g. if the cursor is on the first slash on the line below and the "dw" is typed it deletes from the first slash through and including the '1' character. when moving by word that's what you want, but not for calculating a word span for dw, cw, etc..

// 1234 

for dw it should delete the slashes and the space but not the '1' character

JugglerShu commented 12 years ago

Yes. Vim has "inclusive" and "exclusive" motions. I haven't considered about it yet. I'm planning to add "inclusive" argument to motionFixedFrom:To:. It will be like

motionFixedFrom:(NSUInteger)from To:(NSUInteger)To Inclusive:(BOOL)inclusive

Let me know if the problem is not about the "inclusive" thing.

WarWithinMe commented 12 years ago

Consider the dvw command, should the v change between inclusive and exclusive?

JugglerShu commented 12 years ago

Thanks for the advice. I did not know such behavior of Vim...

JugglerShu commented 12 years ago

I fixed the problem. Now I make enum value to represent motion type. They have "CHARACTERWISE_EXCLUSIVE", "CHARACTERWISE_INCLUSIVE","LINEWISE". "dvw" is also supported now. (I haven't implemented "d C-v w". but its easy to implement I think)

Let me know if some operations do not work fine.

mike-hoegeman commented 12 years ago

excellent! thanks..

On Sat, Mar 3, 2012 at 6:56 AM, JugglerShu reply@reply.github.com wrote:

I fixed the problem. Now I make enum value to represent motion type. They have "CHARACTERWISE_EXCLUSIVE", "CHARACTERWISE_INCLUSIVE","LINEWISE". "dvw" is also supported now. (I haven't implemented  "d C-v w". but its easy to implement I think)

Let me know if some operations do not work fine.


Reply to this email directly or view it on GitHub: https://github.com/JugglerShu/XVim/issues/24#issuecomment-4301216