From 1f52377b2b621327c70e25331e77e9a38047f698 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 31 Jul 2025 13:22:59 +0200 Subject: [PATCH] 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. --- editor/editor.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/editor.lisp b/editor/editor.lisp index 4801c16..91ba88d 100644 --- a/editor/editor.lisp +++ b/editor/editor.lisp @@ -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*))