Repair line-clearing bug.
This commit is contained in:
parent
370b35a273
commit
0882ddb896
|
@ -1,11 +1,5 @@
|
||||||
Make it reloadable
|
Make it reloadable
|
||||||
|
|
||||||
The status line isn't cleared away when you C-x 0.
|
|
||||||
- CLUE: also happens when the window is very narrow and a large jump
|
|
||||||
would clear entire lines, but the lines to be cleared span the
|
|
||||||
entire window. For example, M-> in xterm_controls.txt when the
|
|
||||||
window is ~20 chars wide.
|
|
||||||
|
|
||||||
Preserve column on up/down better.
|
Preserve column on up/down better.
|
||||||
|
|
||||||
Catch and handle SIGWINCH.
|
Catch and handle SIGWINCH.
|
||||||
|
|
|
@ -315,12 +315,17 @@
|
||||||
(not (equal? (vector-ref old-line i) (vector-ref new-line i)))))
|
(not (equal? (vector-ref old-line i) (vector-ref new-line i)))))
|
||||||
|
|
||||||
(define (repair-span! tty old new-line row first-col cell-count)
|
(define (repair-span! tty old new-line row first-col cell-count)
|
||||||
(for ((column (in-range first-col (+ first-col cell-count))))
|
(define trailing-empty-count
|
||||||
(match-define (cons new-pen new-ch) (vector-ref new-line column))
|
(for/fold [(empty-count 0)] [(column (in-range first-col (+ first-col cell-count)))]
|
||||||
(when (non-empty? new-ch)
|
(match-define (cons new-pen new-ch) (vector-ref new-line column))
|
||||||
(set-pen tty new-pen)
|
(if (non-empty? new-ch)
|
||||||
(output tty (goto-if-needed old row column) new-ch)
|
(begin (set-pen tty new-pen)
|
||||||
(advance-cursor! tty old))))
|
(output tty (goto-if-needed old row column) new-ch)
|
||||||
|
(advance-cursor! tty old)
|
||||||
|
0)
|
||||||
|
(+ empty-count 1))))
|
||||||
|
(when (and (positive? trailing-empty-count) (= (+ first-col cell-count) (tty-columns tty)))
|
||||||
|
(output tty (ansi:clear-to-eol))))
|
||||||
|
|
||||||
(define (repair-line! tty old new row)
|
(define (repair-line! tty old new row)
|
||||||
(define columns (screen-columns new))
|
(define columns (screen-columns new))
|
||||||
|
@ -343,8 +348,7 @@
|
||||||
columns))
|
columns))
|
||||||
(insert-columns tty cols-to-insert))
|
(insert-columns tty cols-to-insert))
|
||||||
(repair-span! tty old new-line row first-col cell-count))))
|
(repair-span! tty old new-line row first-col cell-count))))
|
||||||
(begin (repair-span! tty old new-line row 0 columns)
|
(repair-span! tty old new-line row 0 columns)))
|
||||||
(output tty (ansi:clear-to-eol)))))
|
|
||||||
|
|
||||||
(define (tty-flush tty)
|
(define (tty-flush tty)
|
||||||
(define old (tty-displayed-screen tty))
|
(define old (tty-displayed-screen tty))
|
||||||
|
|
Loading…
Reference in New Issue