From cfce6b37be4eb5da69b2027cb35f127e13af9fef Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 3 Nov 2020 20:02:57 +0100 Subject: [PATCH] LibVT: Copying from terminal scrollback resulted in wrong text This regressed when turning the terminal history into a circular buffer as only the non-const version of Terminal::line() was updated with the new indexing logic. --- Libraries/LibVT/Terminal.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h index 615ec78be9..091fd34f4b 100644 --- a/Libraries/LibVT/Terminal.h +++ b/Libraries/LibVT/Terminal.h @@ -81,9 +81,7 @@ public: } const Line& line(size_t index) const { - if (index < m_history.size()) - return m_history[index]; - return m_lines[index - m_history.size()]; + return const_cast(this)->line(index); } Line& visible_line(size_t index)