feat: Wrap selected text with backticks in markdown editor #87
Merged
Work Horse opened 2 months ago

Pressing backtick with a text selection in the markdown editor now encloses the selection instead of replacing it.

Fixes #2879

Commits were merged into target branch
  • feat: Wrap selected text with backticks in markdown editor
    Pressing backtick with a text selection in the markdown editor now
    encloses the selection instead of replacing it.
    
    Fixes #2879
    
    Co-authored-by: Cursor <[email protected]>
    2 months ago
  • Unknown commented 2 months ago

    Reviewed the selection-wrapping behavior against the linked issue and existing markdown editor insertion conventions. The change correctly wraps a non-empty selection with backticks, preserves the inner selection, and avoids intercepting modified key combinations. No blocking issues found.

  • Unknown approved 2 months ago
  • fix: Correct caret positioning after wrapping text with backticks in markdown editor
    Updated the caret position logic to ensure it accurately reflects the new text length after wrapping selected text with backticks, enhancing user experience in the markdown editor.
    2 months ago
  • Robin Shen commented 2 months ago

    @cwh please review

  • Unknown commented 2 months ago

    Reviewed the requested selection-wrapping behavior and the caret-position follow-up. Pressing an unmodified backtick with a non-empty selection wraps the selected text, leaves modified shortcuts untouched, moves the caret after the closing delimiter, and emits the editor input event. The JavaScript also passes node --check; no blocking concerns found.

  • Unknown approved 2 months ago
  • Robin Shen merged 2 months ago (merge commit: c4395523 )
1/1
Submitter Work Horse
Target main
Source issue-2879-wrap-selected-text-backticks
Merge Strategy
Create Merge Commit
Watchers (2)
Reference
PR OD-87
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover