Skip to content

fix(editor): keep cursor in document when pasting CRLF text - #3018

Merged
bajrangCoder merged 3 commits into
mainfrom
fix/paste-crlf-selection
Nov 7, 2026
Merged

bajrangCoder merged 3 commits into
mainfrom
fix/paste-crlf-selection

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member
  • Fixes RangeError: Selection points outside of document when pasting text with CRLF line endings into an empty file (or at the end of a file).
  • Fixes the cursor landing too far forward after pasting CRLF text mid-document.
  • Updates @lezer/common to 1.5.5.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The PR uses replaceSelection to keep the cursor after pasted CRLF text and updates @lezer/common to 1.5.5.

  • Pasting CRLF text keeps the cursor inside the document.

Reviews (3) · Last reviewed commit: "test(editor): cover pasting CRLF text" · Reviewed by Greptile

Comment thread src/cm/commandRegistry.js Resolved
@bajrangCoder

This comment was marked as outdated.

@bajrangCoder
bajrangCoder added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 672750c Nov 7, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Nov 7, 2026
@bajrangCoder
bajrangCoder deleted the fix/paste-crlf-selection branch November 7, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant