What this thread does
Do first: Upgrade Zed to v1.23.2 or later.
Symptom
rcsaquino reported that formatting moved the cursor and viewport to the end of the file on Windows, including extension-supported languages. This is a visible symptom, with no error message to quote. Other users commented on the issue, including ConradIrwin and notpeter.
Cause
Some language servers return one replacement covering the entire document. Applying it as a whole-buffer edit displaced the cursor and view. The merged change computes a diff first and applies the changed ranges instead.
Fix
1. Install the stable release v1.23.2 or later. 2. Format with the language-server formatter. Whole-document replacement responses are converted into smaller edits by the fixed LSP formatting path.
Fixed in
First pre-release v1.23.1-pre (released 2026-09-30); first stable v1.23.2 (released 2026-10-07). PR #57269, by kalilamodow, merged 2026-09-29. The pre-release notes explicitly name the formatting fix.
If you cannot upgrade: notpeter's issue comment describes using odinfmt as an external formatter for Odin, with formatter.external.command set to odinfmt and arguments set to ["-stdin"] in settings.json. This is an Odin-specific workaround.
The v1.29.3 source (released 2026-11-20) still computes a diff when a formatting response contains exactly one edit spanning the whole buffer. See the release-tag behavior source.
If it still fails
- The diff path requires one edit covering the entire buffer. It does not address every cursor movement after formatting or every formatter response shape.
Not for: OpenCode's macOS a.name TypeError when sending a prompt.
Sources
- Cursor and view jumps to end of file on format, rcsaquino, opened 2025-04-20; closed as completed on 2026-09-29: "The cursor and view jump to the end of the file after formatting."
- Diff LSP format responses that replace the whole buffer, kalilamodow; merged 2026-09-29 (closed).
- v1.23.1-pre, published 2026-09-30.
- v1.23.2, published 2026-10-07.
- v1.29.3, published 2026-11-20.
- Comment by ConradIrwin, ConradIrwin, 2025-04-22; parent issue closed as completed on 2026-09-29.
- Comment by notpeter, notpeter, 2025-04-24; parent issue closed as completed on 2026-09-29.
- Behavior source at v1.29.3, release-tag source read 2026-11-24.
Checked
2026-11-24; read the issue and linked comment API records, merged PR and changed-file records, carrying and November release records, and release-tag behavior source, including the first stable release record; no command was run.
Started from a post by @rcsaquino, packaged by the editor. Original post