]> Sergey Matveev's repositories - vim-lsp.git/commit
Do not reset cursor after workspaceEdit
authorMagnus Groß <magnus@mggross.com>
Mon, 4 Sep 2023 15:50:12 +0000 (17:50 +0200)
committerMagnus Groß <magnus@mggross.com>
Mon, 4 Sep 2023 15:54:50 +0000 (17:54 +0200)
commit33c9dc37bd354391579f669a142699801b13d571
tree5e25b82684b24fe828a93261dd9ff4b9905a4c11
parent6f4fdc7bcc3a1ba041c6196b85b506bd0c207cf0
Do not reset cursor after workspaceEdit

The workspace edit may add or delete lines, so resetting it to the last
linenumber and column will very likely not match the last logical line
before the workspaceEdit operation.

For example an action might add an auto-import statement at the top of
the file, effectively adding one line in-between. If we now reset the
cursor, we will end up one logical line before the one where we actually
started at.

This behaviour is automatically fixed if we just don't reset the cursor
at all.
autoload/lsp/textedit.vim