-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
enhancementNew feature or requestNew feature or requestvimRelated to the Neo(Vim) editorRelated to the Neo(Vim) editor
Description
When formatting a file, ruff will replace the entire file with a formatted copy. It should only replace lines that have changed (as far as I can tell, this is what most LSPs do).
The issue with replacing the whole file, is that (at least on neovim) the cursor position is reset to the beginning of the file on background windows/splits, because the entire file was deleted/replaced.
Reproduction steps
- Open a well formatted file in neovim
- Open a split window (
:vsp) - Scroll on window to the middle of the file
- Switch to the unscrolled window
- Add an empty line at the beginning of the file
- Format the file using ruff-lsp
The cursor for the second split will now jump to the top of the file.
AleXoundOS and masar3141
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestvimRelated to the Neo(Vim) editorRelated to the Neo(Vim) editor