ggandor / leap-spooky.nvim

👻 Actions at a distance
The Unlicense
277 stars 7 forks source link

fix `cir`/`ciR` jumping back before insertion is done #5

Closed wodesuck closed 1 year ago

ggandor commented 1 year ago

Sorry, but what does this fix? :)

wodesuck commented 1 year ago

Cursor jump back before leaving insert mode, cause vim.v.operator has been changed.

For example:

abc
def

Cursor at a, type cirwde will delete def, enter insert mode, but cursor at a. Expected behaviour is, delete def, enter insert mode, cursor at d, and jump back to a when leaving insert mode.

ggandor commented 1 year ago

Oh, awesome! I've been aware of this bug - what's interesting is that I cannot always reproduce. E.g. your above example works as expected for me. Just guessing, but this issue might have to do something with vim/vim#9332 (:normal causing all kinds of surprising state changes)? Anyway, the PR indeed seems to fix it for all cases though, so thanks very much.