Add failsafe to REDISPLAY-LINE for when the editor fucks it up

Occasionally the editor will try to redisplay lines that are
off-screen, even though that shouldn't happen. Ignoring it is
seemingly harmless, so it now signals a warning.
This commit is contained in:
John Lorentzson 2025-07-31 13:22:59 +02:00
parent f3cbadfa54
commit 1f52377b2b

View file

@ -424,7 +424,7 @@ serial connection the editor normally runs under.")
(move-cursor (view-line-number (buffer-view buffer) line) char-pos)
(write-char (aref (line-content line) char-pos) *eio*)
(update-buffer-cursor buffer)))
(t
((line-in-view line (buffer-view buffer))
(hide-cursor)
(move-cursor (view-line-number (buffer-view buffer) line) start)
(write-byte #x1B *eio*)
@ -432,7 +432,9 @@ serial connection the editor normally runs under.")
(write-char #\K *eio*)
(write-string (line-content line) *eio* :start start)
(update-buffer-cursor buffer)
(show-cursor))))
(show-cursor))
(t
(warn "Tried to redisplay an off-screen line."))))
(force-output *eio*))