LibVT: Update the terminal buffer based on visible lines

Lines in the history should not be considered for update at all.
Fixes #2185
This commit is contained in:
AnotherTest 2020-05-11 11:54:00 +04:30 committed by Andreas Kling
parent 87b6578516
commit 5b9fe0cf46
Notes: sideshowbarker 2024-07-19 06:44:35 +09:00
2 changed files with 11 additions and 2 deletions

View File

@ -144,6 +144,15 @@ public:
return m_lines[index - m_history.size()];
}
Line& visible_line(size_t index)
{
return m_lines[index];
}
const Line& visible_line(size_t index) const
{
return m_lines[index];
}
size_t max_history_size() const { return 500; }
const NonnullOwnPtrVector<Line>& history() const { return m_history; }

View File

@ -465,9 +465,9 @@ void TerminalWidget::flush_dirty_lines()
}
Gfx::Rect rect;
for (int i = 0; i < m_terminal.rows(); ++i) {
if (m_terminal.line(i).dirty) {
if (m_terminal.visible_line(i).dirty) {
rect = rect.united(row_rect(i));
m_terminal.line(i).dirty = false;
m_terminal.visible_line(i).dirty = false;
}
}
update(rect);