You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
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.
When formatting a file,
ruffwill 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
:vsp)The cursor for the second split will now jump to the top of the file.