Skip to content

Fix cursor x-position on empty lines with first-line indent#15

Merged
Wavesonics merged 1 commit into
mainfrom
claude/fix-indent-cursor-position-tJcl4
May 17, 2026
Merged

Fix cursor x-position on empty lines with first-line indent#15
Wavesonics merged 1 commit into
mainfrom
claude/fix-indent-cursor-position-tJcl4

Conversation

@Wavesonics
Copy link
Copy Markdown
Owner

The empty-line indent workaround in calculateCursorPosition only
covered line-block paragraph styles (bullet, blockquote, list, code
fence). When the editor's own textStyle.textIndent.firstLine was set,
the cursor still sat at x=0 on an empty line and visibly snapped to
the indent the moment the user typed the first character.

Generalize the fix to fall back to the editor-wide textStyle.textIndent
when no line-block is attached. Block-line indent still takes precedence
since updateBookKeeping doesn't bake the editor-wide indent onto lines
that already carry a ParagraphStyle.

The empty-line indent workaround in `calculateCursorPosition` only
covered line-block paragraph styles (bullet, blockquote, list, code
fence). When the editor's own `textStyle.textIndent.firstLine` was set,
the cursor still sat at `x=0` on an empty line and visibly snapped to
the indent the moment the user typed the first character.

Generalize the fix to fall back to the editor-wide `textStyle.textIndent`
when no line-block is attached. Block-line indent still takes precedence
since `updateBookKeeping` doesn't bake the editor-wide indent onto lines
that already carry a `ParagraphStyle`.
@Wavesonics Wavesonics merged commit e8fbaf8 into main May 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants