Closed vds2212 closed 12 months ago
Thanks for the report and the info on how to reproduce this issue!
The source seems to be the fact that the plugin is rewriting the whole file using isort's output, and that basically erases any jumps, marks, etc that vim has for each line, as they're all new lines after the sorting.
The solution is to try to override only the lines doing imports, and only if they changed. But there isn't an easy way of doing that, I'll have to either identify the changed lines with some kind of "diff" logic, or to identify import lines to send only those to isort and replace only those on the way back. I'll try those approaches and post any updates here.
I've just pushed a new version! Let's hope the issues are fixed.
Thanks for looking at the issue. I'll test your new version and let you know :-)
Thanks for your suppor!
It works like a charm!
Thanks for being so reactive. And thanks you for Isort :-)
If I use the command
Isort
and that Isort change the files the jump positions of the current buffer are gone.To reproduce it you can:
G
)gg
):Isort
)If you use the
:jumps
command you'll see that they are gone.I don't have the same behavior with the
:Format
command that comes with coc.nvim