Skip to content

feat(core): wrapIndent for soft-wrap continuations - #1346

Open
Hyuuh wants to merge 2 commits into
anomalyco:mainfrom
Hyuuh:feat/wrap-indent
Open

feat(core): wrapIndent for soft-wrap continuations#1346
Hyuuh wants to merge 2 commits into
anomalyco:mainfrom
Hyuuh:feat/wrap-indent

Conversation

@Hyuuh

@Hyuuh Hyuuh commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • Add wrapIndent (none | same, default none) so soft-wrap continuations keep the logical line's leading indent (VS Code wrappingIndent: "same").
  • Zig layout stores VirtualLine.pad_cols and narrows continuation wrap width; paint offsets content and hit-testing/cursor stay consistent with painted geometry.
  • Wired through FFI → TextBufferView / EditorViewTextBufferRenderable / EditBufferRenderable (wrapIndent prop). No breaking change when omitted.

Note: orthogonal to #1330 (chunk-boundary reflow after edits).

Test plan

  • bun run test:native -Dtest-filter="wrap indent" (9/9)
  • Related filters: wrapping / word wrap / moveDownVisual
  • TS smoke: Textarea wrapIndent get/set
  • Manual: indented line + wrapMode: "word"|"char" + wrapIndent: "same" — continuations paint under indent; click pad → caret at content start; ↓ from col 0 → content start of continuation

Add optional same-indent for soft-wrapped lines so continuations keep the
logical line's leading indent in both layout and paint, with cursor and
hit-testing staying consistent. Default remains none.
Yoga measure and truncate used content-only width_cols, so padded
continuations could under-report intrinsic width or skip ellipsis.
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.

1 participant