Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
In the in-editor Markdown Preview (the Markdown | Preview toggle on a .md tab, not Ctrl+Shift+V), editing a file that uses CRLF line endings resets the caret to the very start of the document after a keystroke.
What happens:
- I click in the middle of the document and type one character (or change a single digit).
- The whole document appears to be re-rendered: the view scrolls back to the top and the caret jumps to the start of the document.
- The next keystrokes land at the beginning of the first heading. For example,
# My planends up as# aMy plan.
The same file converted to LF (status bar CRLF → LF, save, reopen Preview) works normally. Several LF test files with similar content never showed the problem; the CRLF file showed it on every edit.
My guess at the cause (not verified against the source): Preview serializes its document back to Markdown with \n. That never matches the \r\n buffer, so the editor replaces the whole model on each edit, and the selection resets to offset 0.
On Windows this is easy to hit, because many tools write CRLF by default: PowerShell Set-Content / Out-File, Python text mode, and Git with core.autocrlf=true, which is the default in Git for Windows.
Possibly related (closed): Plan editor is totally broken. A reply there mentions the caret jumping to the top of Markdown files while typing.
Steps to Reproduce
- On Windows, create a Markdown file with CRLF line endings. Mine was a ~150-line plan document with headings; I have not tried a minimal file yet. A CRLF file can be made in PowerShell like this:
Set-Content test.md "# Title`r`n`r`nline 1`r`nline 2`r`n`r`n## Section`r`n`r`nsome text 123" - Open it in Cursor. The status bar shows
CRLF. - Switch the tab to Preview mode.
- Click inside a paragraph near the end and type a character, or change a number.
- Observe: the view jumps to the top, the caret moves to the start of the document, and further typing goes into the first heading.
- Click
CRLFin the status bar, chooseLF, save, and repeat step 4: editing behaves normally.
Expected Behavior
- The caret stays where I am typing, regardless of the file’s line endings.
- Editing in Preview preserves the file’s existing line endings instead of fighting them.
Operating System
Windows 11
Version Information
Cursor: 3.25.9 (stable)
VSCode Version: 1.128.0
Commit: 5d4df965746c5d09740842fc0f1331ba1c157830
Date: 2026-10-15T21:52:24.891Z
OS: Windows 11 Pro for Workstations 10.0.26300
Reproduced on 3.25.9 (current stable at the time). Not yet tried on 3.26.13, and I could not find anything about this in the changelog.
Does this stop you from using Cursor
No. Cursor works, but Preview editing is unusable on CRLF files until I convert them to LF.