You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the renderer flush, lines are skipped if they match the previous line. However, the comparison between the current and previous lines is not done properly.
This trimming causes the index to be lost. The first item in oldLines may not correspond to the first item in newLines if the number of lines in the current buffer exceeds the terminal height.
In some cases, this leads to skipping line updates even when two lines are not the same (and vice versa). This happens because oldLines always starts from the top of the previous buffer, while newLines may have been truncated.
The solution is to compare the most recently rendered lines with the new lines, instead of comparing the lines from the beginning of the previous buffer.
Setup
Please complete the following information along with version numbers, if applicable.
OS: Debian
Shell: zsh
Terminal Emulator: kitty
Terminal Multiplexer: tmux
To Reproduce
It can be reproduced with the following steps:
Press j to increase the number of lines until it exceeds the terminal height.
Press k to decrease the number of lines until it is smaller than the terminal height.
You will observe that the lines are misaligned, with each line appearing one row higher than its correct position on the screen, and the first line will be missing.
Describe the bug
In the renderer
flush
, lines are skipped if they match the previous line. However, the comparison between the current and previous lines is not done properly.After that, the
newLines
are trimmed based on the terminal height to fit the screen:This trimming causes the index to be lost. The first item in
oldLines
may not correspond to the first item innewLines
if the number of lines in the current buffer exceeds the terminal height.The issue occurs in the following comparison:
In some cases, this leads to skipping line updates even when two lines are not the same (and vice versa). This happens because
oldLines
always starts from the top of the previous buffer, whilenewLines
may have been truncated.The solution is to compare the most recently rendered lines with the new lines, instead of comparing the lines from the beginning of the previous buffer.
Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
It can be reproduced with the following steps:
j
to increase the number of lines until it exceeds the terminal height.k
to decrease the number of lines until it is smaller than the terminal height.Expected behavior
Lines should be skipped correctly only when the current line is identical to the previously rendered line
Screenshots
Adding lines...
Deleting lines...
The text was updated successfully, but these errors were encountered: