Reduce flickering of the list when the list is truncated by --tail

This commit is contained in:
Junegunn Choi 2024-06-07 16:58:56 +09:00
parent c4a9ccd6af
commit 368294edf6
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -1982,7 +1982,7 @@ func (t *Terminal) printItem(result Result, line int, maxLine int, index int, cu
newLine := itemLine{firstLine: line, cy: index + t.offset, current: current, selected: selected, label: label,
result: result, queryLen: len(t.input), width: 0, hasBar: line >= barRange[0] && line < barRange[1], minIndex: t.merger.minIndex}
prevLine := t.prevLines[line]
forceRedraw := prevLine.other || prevLine.firstLine != newLine.firstLine || prevLine.minIndex != t.merger.minIndex
forceRedraw := prevLine.other || prevLine.firstLine != newLine.firstLine
printBar := func(lineNum int, forceRedraw bool) bool {
return t.printBar(lineNum, forceRedraw, barRange)
}