yangmillstheory / vim-snipe

MIT License
118 stars 8 forks source link

When cancelling a command with an operator, always stay in normal mode #26

Open vimeitor opened 6 years ago

vimeitor commented 6 years ago

Hello again :-)

Using map <leader><leader>f <Plug>(snipe-f) as keybinding Pressing c<leader><leader>f<esc> should stay in normal mode instead of going in insert mode.

And if I'm not mistaken, if you go through with the jump, you undo, then you try to do the same jump with the same letter but you cancel, everything is deleted until the first occurrence of the letter. For example

"random piece of text" c<leader><leader>fe shows "random piacs of tdxt" You go through with d, so you end up with "xt" You undo. You press c<leader><leader>f<esc> and you get "ece of text"

yangmillstheory commented 6 years ago

It's possible for Visual mode cancellation to place you into Normal mode. I'm not sure this is actually possible for Operator-pending mode when it places you in Insert mode - i.e. c. Thus, I'll hold off on making the change for Visual mode to avoid inconsistency.

"random piece of text"...

I can't reproduce this.