Closed sourcesoft closed 7 years ago
@sourcesoft OK, this is a rather exotic behavior. :thinking:
If you put the import statement in another line (e.g. the 20th instead of the 1st), does this jump the cursor to the import-line as well?
Is this only when using prettier as the reformatter? Did you try to go back to the cursor position with <C-o><C-o>
?
I have no experience with neoformat
and I am not sure, whether this has anything to do with the plugin itself or with any formatting backend. If you have additional input, I'd be glad to test it out.
does this jump the cursor to the import-line as well?
always jumps to the line with import statement
Is this only when using prettier as the reformatter?
happens without prettier too
Did you try to go back to the cursor position with
?
just ran :Neoformat manually inside vim and it jumps
@sourcesoft I think I managed to find the culprit of the issue. It's the following line/lines: syntax/javascript.vim#L56,L57
I will keep you updated on the progress.
@sourcesoft I have found and fixed the issue, will upload shortly.
P.S.: I had to supply the 'n' flag to the search
call. Thanks vim-docs. :slightly_smiling_face:
related to https://github.com/sbdchd/neoformat/issues/55
seems like using
neoformat
withvim-styled-components
makes the cursor jump to import statement on every save, which gets solved after removing this plugin.