Add Shift-Up/Down full-page scroll in the TUI
ober
2ea7b2ea547dccdbfe2cffbd0afd4bfb401a0662
--- a/src/jcode/ui/tui.ss +++ b/src/jcode/ui/tui.ss @@ -425,6 +425,23 @@ (max 0 (- (app-state-scroll-offset state) (quotient (msg-area-height state) 2)))) (app-state-dirty?-set! state #t)) + ;; Global: Shift-Up / Shift-Down full-page scroll. An arrow-key + ;; alternative to Page-up/down for keyboards that remap the Page keys + ;; (e.g. Kinesis). Plain Up/Down (no Shift) fall through to the input + ;; field below. Jumps a full message-area height per press. + ((and (= key TB_KEY_ARROW_UP) + (not (zero? (bitwise-and mod TB_MOD_SHIFT)))) + (tui-log " -> shift-up page scroll") + (app-state-scroll-offset-set! state + (+ (app-state-scroll-offset state) (msg-area-height state))) + (app-state-dirty?-set! state #t)) + ((and (= key TB_KEY_ARROW_DOWN) + (not (zero? (bitwise-and mod TB_MOD_SHIFT)))) + (tui-log " -> shift-down page scroll") + (app-state-scroll-offset-set! state + (max 0 (- (app-state-scroll-offset state) (msg-area-height state)))) + (app-state-dirty?-set! state #t)) + ;; Ctrl-C or ESC during agent: cancel. Orphan the worker (bump gen ;; so its future events are discarded) and give immediate UI ;; feedback. The worker will notice *tui-stream-abort* on its next @@ -552,7 +569,7 @@ " /sidebar Toggle sidebar (Ctrl-B)" " /quit Exit" "" - "Keys: Alt-Enter submit | PgUp/PgDn scroll | Ctrl-C cancel | Shift-Tab toggle PLAN/BUILD") + "Keys: Alt-Enter submit | PgUp/PgDn or Shift-↑/↓ scroll | Ctrl-C cancel | Shift-Tab toggle PLAN/BUILD") "\n")))) ((equal? cmd "quit") (app-state-quit?-set! state #t))