diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-11 11:54:00 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-11 09:33:18 +0200 |
commit | 5b9fe0cf46e7c99283afe72581568abbfa261cdf (patch) | |
tree | 8be79ddfa5b5b69316f42176b7464d0f93c359bf /Libraries/LibVT | |
parent | 87b657851611d955dcdc31f5695e265989b00c82 (diff) | |
download | serenity-5b9fe0cf46e7c99283afe72581568abbfa261cdf.zip |
LibVT: Update the terminal buffer based on visible lines
Lines in the history should not be considered for update at all.
Fixes #2185
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r-- | Libraries/LibVT/Terminal.h | 9 | ||||
-rw-r--r-- | Libraries/LibVT/TerminalWidget.cpp | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h index e3946e2fe3..38f42dcdb8 100644 --- a/Libraries/LibVT/Terminal.h +++ b/Libraries/LibVT/Terminal.h @@ -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; } diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index 845650e0d3..c8db17f80c 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -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); |