Fix vterm crash: guard negative line-start in vterm-apply-row-colors!
ober
f992cf058bae59ec074af63bffa5b2a4b6ca5c76
--- a/lib/jerboa-emacs/qt/app.sls +++ b/lib/jerboa-emacs/qt/app.sls @@ -233,7 +233,9 @@ (let* ([cols (vtscreen-cols vt)] [line-start (sci-send ed SCI_POSITIONFROMLINE doc-line)] [line-end (sci-send ed SCI_GETLINEENDPOSITION doc-line)] - [line-len (min (- line-end line-start) cols)]) + [line-len (if (>= line-start 0) + (min (- line-end line-start) cols) + 0)]) (when (> line-len 0) (let loop ([c 0] [run-start 0] [run-style #f]) (if (>= c line-len) --- a/src/jerboa-emacs/qt/app.ss +++ b/src/jerboa-emacs/qt/app.ss @@ -276,7 +276,7 @@ (let* ((cols (vtscreen-cols vt)) (line-start (sci-send ed SCI_POSITIONFROMLINE doc-line)) (line-end (sci-send ed SCI_GETLINEENDPOSITION doc-line)) - (line-len (min (- line-end line-start) cols))) + (line-len (if (>= line-start 0) (min (- line-end line-start) cols) 0))) (when (> line-len 0) ;; Walk the row and apply styles in runs of same color (let loop ((c 0) (run-start 0) (run-style #f))