Galooshi/vim-import-js

Restoring cursor position can be incorrect if cursor starts inside import block

lencioni opened this issue · 1 comments

When replacing the buffer we track the cursor position and then simply move it by the number of lines that were added. If you happen to be in the imports block, this can be incorrect.

I think the fix for this involves moving cursor restoration into the import-js plugin itself. The client will send the current position on import start, then import-js will calculate where it should end up after the import is done and send it back in the response.