1
0
Fork 0

- improved a bit rendering of text in message window.

This commit is contained in:
cage 2021-02-18 19:43:27 +01:00
parent 121eaed346
commit bb53d98f4c
4 changed files with 22 additions and 5 deletions

View File

@ -949,4 +949,7 @@ to the array"
(defmacro with-profile-time (&body body)
`(with-output-to-string (stream)
(let ((*trace-output* stream))
(time ,@body))))
(time (progn ,@body)))))
(defmacro with-debug-print-profile-time ((&optional prefix) &body body)
`(misc:dbg "~a ~a" ,prefix (with-profile-time ,@body)))

View File

@ -230,7 +230,8 @@
:defun-w-lock
:with-lock
:get-url-content
:with-profile-time))
:with-profile-time
:with-debug-print-profile-time))
(defpackage :box
(:use

View File

@ -231,7 +231,7 @@
(color-name-p (keywordp color))
(attributes (first (fourth parsed))))
(list (first clean)
(make-color-re-assign re
(make-color-re-assign (cl-ppcre:create-scanner re)
(and color-name-p color)
(and (not color-name-p) color)
attributes))))

View File

@ -295,10 +295,23 @@ latter has a length equals to `total-size'"))
(bgcolor nil)
(attributes nil)
(return-as-list-p t))
(colorize-line line
(create-scanner regexp)
:fgcolor fgcolor
:bgcolor bgcolor
:attributes attributes
:return-as-list-p return-as-list-p))
(defmethod colorize-line ((line string) (regexp function)
&key
(fgcolor nil)
(bgcolor nil)
(attributes nil)
(return-as-list-p t))
(let ((res ())
(scanner (create-scanner regexp)))
(scanner regexp))
(labels ((append-to-res (data)
(setf res (append res (list data))))
(setf res (reverse (push data res))))
(re-split (data)
(when (string-not-empty-p data)
(multiple-value-bind (start-re end-re)