A simple, high performance text editor.
Go to file
Greg Pomerantz 6bd5588ade editor: don't clamp the restored scroll offset against an unmeasured MaxScroll
maybeApplyRestoreScroll applied the offset as soon as the content had
landed, then clamped it to MaxScroll. For a string buffer (small file)
MaxScroll derives from the shaper's last baseline, which is still 0 at
that point - nothing has shaped yet - so every restored offset was
clamped to 0 and the scroll position was silently lost on relaunch
(the line-pin that re-derives the offset had already been armed from
the zeroed value).

Wait for the first shaped frame (its feedback triggers the emitFrame
that re-runs the apply; a chunked buffer's MaxScroll is measured from
the line index and needs no such wait). A deadline bounds the wait so
content that never produces a baseline (empty, newlines-only) cannot
leave the restore armed forever - it lands best-effort.

Verified on the emulator: 120-line file, scroll to line 75, relaunch -
lands at line 75 (log: RESTORE scroll off=1272.7 line=75
maxScroll=1272.7; before the fix: off=0.0 maxScroll=0.0).
2026-09-20 10:48:52 -04:00
.qwen Add ShapeText/DrawShapedText: single shaper call, zero-call drawing 2026-05-12 12:06:28 -04:00
cmd/pad IME: accept the one stale-caret commit after a key-event edit; fix the IME hold 2026-09-19 21:52:35 -04:00
doc IME: accept the one stale-caret commit after a key-event edit; fix the IME hold 2026-09-19 21:52:35 -04:00
internal editor: don't clamp the restored scroll offset against an unmeasured MaxScroll 2026-09-20 10:48:52 -04:00
scripts IME: map commits against the whole buffer; drop the renderer-side model 2026-09-13 11:57:38 -04:00
tools/touchinject Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
.DS_Store Add drawPng function to Renderer for PNG icon rendering 2026-05-10 06:26:29 -04:00
.gitignore Pinch-to-font-size (continuous, content-point pinned) + IME-open scroll fix 2026-08-23 09:00:51 -04:00
go.mod IME: guard distant commits; arm the resync on the first anomaly 2026-09-13 22:31:28 -04:00
go.sum IME: guard distant commits; arm the resync on the first anomaly 2026-09-13 22:31:28 -04:00