Repository navigation
Commit 4cedad6
fix(cell): draw spaces into a freshly cleared screen
After Init or Resume, the first frame skips every cell that the
application fills with a space in the default style. The terminal keeps
showing the blank cells left by clearing the screen. Most terminals draw
a blank cell and a space the same way, but kitty does not. It draws a
symbol from the private use area, such as a Nerd Font icon, over two
cells only if an actual space follows it, and scales it down to one cell
otherwise. File icons in lazygit come out too small for this reason
until something redraws the cells after them. See kovidgoyal/kitty#10790
for an analysis.
Marking a cell dirty changes lastStr so that it differs from currStr. It
becomes an empty string, or a space if the cell has never been drawn. If
the application then puts that same value into the cell without changing
its style, Dirty sees no difference and the cell is not drawn. At
startup and after Resume, CellBuffer.Resize marks all cells dirty while
they are still empty, so the first frame skips every space in the
default style.
This is a regression. The space marker for cells that have never been
drawn came with gdamore#1108 (v3.4.0), and it was meant to force a redraw of
such cells. Startup has skipped the spaces since then. Resume has
skipped them since gdamore#1176 (v3.6.0) made Resize mark new cells dirty.
Record a redraw in a flag of its own, so that nothing put into the cell
can make it clean before it is drawn. The first frame after Init or
Resume now writes every blank cell again, as v3.3.0 did. This is about
as much output as a redraw after resizing the window. For lazygit in a
250x70 terminal, the output at startup grows from 10 KB to 25 KB, and a
single resize redraw is 23 KB. Later frames are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent d3a071c commit 4cedad6
3 files changed
Lines changed: 76 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 33 | + | |
| 34 | + | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
| |||
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
162 | | - | |
163 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
168 | 164 | | |
169 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
778 | 823 | | |
779 | 824 | | |
780 | 825 | | |
| |||
0 commit comments