svermeulen / vim-subversive

Vim plugin providing operator motions to quickly replace text
MIT License
295 stars 4 forks source link

Multi line substitute swapping sometimes doesn't work correctly #1

Open svermeulen opened 5 years ago

svermeulen commented 5 years ago

Given the following buffer with cursor at ^

^one
two
three
four

jim
joe
frank
fred

Execute yjjjyj to copy two multiline yanks to yoink history. Move cursor:

one
two
three
four

^jim
joe
frank
fred

Hit sj<c-n> to perform a substitute then swap. Notice the buffer now appears as:

one
two
three
four

jim
one
two
fred

When it should be:

one
two
three
four

one
two
frank
fred
svermeulen commented 5 years ago

This is because the vim undo operation does not always restore the cursor to the position it was before the operation took place, and the swapping logic assumes this. So I think we need to wait for neovim to fix this issue