Being on the frame line is not the same as having no locals

This commit is contained in:
Joseph Ferano 2026-09-12 12:30:51 +07:00
parent 4857db1fc4
commit 3439dec5b1
2 changed files with 9 additions and 4 deletions

View File

@ -342,7 +342,14 @@ list already says it."
(interactive)
(let ((expr (get-text-property (point) 'flan-cnr-inspect)))
(unless expr
(user-error "flan: %s" (flan-cnr--why 'locals)))
;; Two different misses, and saying the wrong one sends someone looking
;; for a missing feature when they are one keystroke away. Being *on* a
;; frame is the common case — the frame line is what the eye lands on —
;; so name TAB rather than repeating why a local might be absent.
(user-error
(if (get-text-property (point) 'flan-cnr-frame)
"flan: this is the frame's own line; TAB opens it, then i on a local"
"flan: point is not on a local — TAB opens a frame, i inspects a local in it")))
(require 'flan-inspect)
(flan-inspect expr)))

View File

@ -108,6 +108,7 @@
(return))
(let [left? (and (> col 0) (empty-at? y (- col 1)))
right? (and (< col (- cols 1)) (empty-at? y (+ col 1)))]
(pause)
(when (or left? right?)
(let [side (cond
(not left?) 1
@ -418,8 +419,6 @@
col (/ (i32 (.x m)) cell-size)]
(paint-at row col)))
(defstruct Pause [])
;; Every cross-function call in a dev build routes through an indirection cell,
;; so redefining this from the REPL reaches the running loop on the next frame.
;; No `varfn` (Janet), no `let update = ref` (OCaml), no var-routing (jank).
@ -441,7 +440,6 @@
(when (rl/key-released? :space) (next-color) (plink 1.4))
(when (rl/mouse-button-pressed? :right) (reset-view) (plink 0.6))
(when (rl/mouse-button-pressed? :left) (plink 1.0))
(when (rl/key-pressed? :f) (error (Pause {})))
(when (rl/key-pressed? :m) (toggle-music))
;; The pad, when there is one. Pressed and released are separate events here
;; too, for the same reason.