Files
orca/src
Jinjing 220f9747ab fix: Cmd+X in rich markdown editor deletes only the current line (#545)
* fix: Cmd+X in rich markdown editor deletes only the current line

- Guard against depth < 1 (GapCursor before top-level leaf nodes) to
  prevent RangeError crash
- Add visual-line cutting for word-wrapped paragraphs so Cmd+X removes
  one visual line at a time instead of the entire paragraph
- Normalize soft line breaks on load/update: split paragraphs with
  embedded \n into separate paragraph nodes so block-level cut works
  per-line
- Add comprehensive tests for cut handler behavior and normalization

* fix: address review findings

- Normalize soft breaks at all document depths (not just top-level)
  using doc.descendants() instead of doc.forEach()
- Capture transaction lazily from editor.view.state.tr to avoid stale
  state after setContent()

* fix: use editor.view.state consistently in normalizeSoftBreaks

Read doc and create tr from editor.view.state (not editor.state) so
position collection and transaction application share the same base
state, avoiding stale-doc corruption after setContent().
2026-04-12 14:16:00 -07:00
..