-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Entering something like this:
(format t "~s" '(hello some test arithmetic))
is printed like
(HELLO
SOME
TEST
etc
I found it's because of syntax-hl
, then I do this to enable it ONLY in case of syntax highlihgting.
(when *syntax-highlighting*
(rl:register-function :redisplay #'syntax-hl))
(edit) or rather
(if *syntax-highlighting*
(rl:register-function :redisplay #'syntax-hl)
(rl:register-function :redisplay #'rl:redisplay))
I also don't understand the magic it's doing.
(defun syntax-hl ()
;; XXX: when enabled, this f* up the whitespace output of the first output line.
;; To try, print this:
;; (format t "~s" '(hello some test arithmetic))
;; it will be shown on multiple lines with lots of whitespace.
(rl:redisplay)
(let ((res (maybe-highlight rl:*line-buffer*)))
(format t "~c[2K~c~a~a~c[~aD" #\esc #\return rl:*display-prompt* res #\esc (- rl:+end+ rl:*point*))
(when (= rl:+end+ rl:*point*)
(format t "~c[1C" #\esc))
(finish-output)))
Metadata
Metadata
Assignees
Labels
No labels