File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -411,22 +411,20 @@ and INHERIT-INPUT-METHOD see function `read-string' for more information."
411411
412412For arguments OLD, NEW and S; see the function `eask-s-replace'
413413for more information."
414- (if-let* ((data (eask-ansi-codes s ))
415- (splits ( split-string s ( regexp-quote old))) )
416- ( let* ( (result (nth 0 splits))
414+ (if-let* ((splits ( split-string s ( regexp-quote old)) ))
415+ ( let* ((reset " \e [0m " )
416+ (result (nth 0 splits))
417417 (index 1 )
418- (base 0 )
419- (reset (car (last data))))
418+ (last ))
420419 (while (< index (length splits))
421- (let ((start ( nth base data ))
422- (end ( nth ( 1+ base) data))) ; \e[0m
423- ( setq result (concat result
424- end new start
420+ (let* ((data (eask-ansi-codes result) ))
421+ ( setq last ( car ( last data))
422+ result (concat result
423+ ( if ( null last ) " " reset) new last
425424 (nth index splits))))
426- (cl-incf base 2 )
427425 (cl-incf index))
428426 ; ; Just ensure the last character is reset.
429- (concat result reset))
427+ (concat result ( if ( null last ) " " reset) ))
430428 (eask-s-replace old new s)))
431429
432430; ;
You can’t perform that action at this time.
0 commit comments