Skip to content

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

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

feat(core): wrapIndent for soft-wrap continuations#1346
Hyuuh wants to merge 4 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" (13/13)
  • Related filters: wrapping / word wrap / moveDownVisual / occupancy
  • 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

Hyuuh added 2 commits August 24, 2026 08:22
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.
@Hyuuh
Hyuuh force-pushed the feat/wrap-indent branch from 7aa0dca to 2f856d4 Compare August 24, 2026 11:27
Hyuuh added 2 commits August 24, 2026 08:40
Public VisualCursor paint APIs include continuation pad; internal
translation stays content-relative. Indent tabs use the engine's
fixed tab_width, same as utf8.charWidth.
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