diff --git a/editor/editor.lisp b/editor/editor.lisp index ba6a2cd..a871733 100644 --- a/editor/editor.lisp +++ b/editor/editor.lisp @@ -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)