A simple, high performance text editor.
Go to file
Greg Pomerantz e3690d6b98 Restore last file, cursor, scroll, selection and find state on relaunch (spec §7)
Persist a tiny JSON snapshot (SessionState) written by the cmd layer
($HOME/.pad/session.json off-Android, /storage/emulated/0/Pad/ on
Android) and call the logic-owned snapshot rate-limited (<=1/s, on
change) from emitFrame plus unconditionally at Shutdown. On launch the
cmd layer hands the snapshot to Logic.BeginRestore before Run; the
file re-opens through the normal openFile path and lands straight on
the editor page.

- Cursor/selection land with the content, clamped to a shrunk file
  (path-guarded so a late result for a replaced file cannot apply the
  snapshot to the wrong buffer); a missing file falls back to the
  browser.
- Scroll is applied only after the first ScaleEvent has been laid out:
  the size ConfigEvent precedes it and the one-way MaxScroll clamp in a
  wrong-unit layout would corrupt the offset (found by e2e).
- Find: query + open/closed + current match are persisted; results are
  regenerated by re-scanning and the saved current match is re-selected
  by byte offset (Find.Restoring/RestoreMatch) without re-scrolling the
  restored viewport. A closed-bar query re-scans on the next bar open
  instead (an eager scan would be dropped and leave Scanning stuck).
- The main-owned find_bar widget is seeded with the restored query so
  its first frame matches the logic-side query.

Docs: spec.md gains §2.4 and drops the §7 row; invariant 5 updated;
architecture.md gains §6.7. Tests: 7 e2e tests covering cursor/scroll/
selection restore, clamping, missing-file fallback, find-bar restore
(open/closed), and the saver/shutdown persist paths.
2026-08-20 16:01:02 -04:00
.qwen Add ShapeText/DrawShapedText: single shaper call, zero-call drawing 2026-05-12 12:06:28 -04:00
cmd/pad Restore last file, cursor, scroll, selection and find state on relaunch (spec §7) 2026-08-20 16:01:02 -04:00
doc Restore last file, cursor, scroll, selection and find state on relaunch (spec §7) 2026-08-20 16:01:02 -04:00
internal Restore last file, cursor, scroll, selection and find state on relaunch (spec §7) 2026-08-20 16:01:02 -04:00
scripts Make the release process script-driven and documented 2026-08-20 14:54:48 -04:00
.DS_Store Add drawPng function to Renderer for PNG icon rendering 2026-05-10 06:26:29 -04:00
.gitignore Refactor RealFileSystem to use WorkingDir, and ensure clean shutdown with FlushAll 2026-06-05 11:42:39 -04:00
go.mod Update to gioui v0.10.0. 2026-06-03 22:17:52 -04:00
go.sum Update to gioui v0.10.0. 2026-06-03 22:17:52 -04:00