Repair line-clearing bug.
This commit is contained in:
parent
370b35a273
commit
0882ddb896
|
@ -1,11 +1,5 @@
|
|||
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.
|
||||
|
||||
Catch and handle SIGWINCH.
|
||||
|
|
|
@ -315,12 +315,17 @@
|
|||
(not (equal? (vector-ref old-line i) (vector-ref new-line i)))))
|
||||
|
||||
(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
|
||||
(for/fold [(empty-count 0)] [(column (in-range first-col (+ first-col cell-count)))]
|
||||
(match-define (cons new-pen new-ch) (vector-ref new-line column))
|
||||
(when (non-empty? new-ch)
|
||||
(set-pen tty new-pen)
|
||||
(if (non-empty? new-ch)
|
||||
(begin (set-pen tty new-pen)
|
||||
(output tty (goto-if-needed old row column) new-ch)
|
||||
(advance-cursor! tty old))))
|
||||
(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 columns (screen-columns new))
|
||||
|
@ -343,8 +348,7 @@
|
|||
columns))
|
||||
(insert-columns tty cols-to-insert))
|
||||
(repair-span! tty old new-line row first-col cell-count))))
|
||||
(begin (repair-span! tty old new-line row 0 columns)
|
||||
(output tty (ansi:clear-to-eol)))))
|
||||
(repair-span! tty old new-line row 0 columns)))
|
||||
|
||||
(define (tty-flush tty)
|
||||
(define old (tty-displayed-screen tty))
|
||||
|
|
Loading…
Reference in New Issue