Fix bug in editor's CSI dispatch causing errors on some unknown keys

This commit is contained in:
John Lorentzson 2025-07-28 16:19:38 +02:00
parent c75698541a
commit 0da45020db

View file

@ -808,11 +808,14 @@ Additionally ensures correct line numbers on the way, as a bonus."
(defun csi-handler ()
(loop :for buffer := '() :then (append buffer (list (read-char *eio*)))
:for found := (assoc buffer *csi-sequences* :test #'equalp)
:when (or found (not (zerop (some
(lambda (c)
(search buffer (car c)))
*csi-sequences*))))
:return (cadr found)))
:for match-point := (some
(lambda (c)
(search buffer (car c)))
*csi-sequences*)
:when (or found (null match-point)
(and (numberp match-point)
(not (zerop match-point))))
:return (or (cadr found) :unknown)))
(defun esc (key)
(when (numberp key)