1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:07:45 +00:00

Kernel+LibVT: Fix selection with scrollback wrap-around

If lines are removed from the tail of the scrollback buffer, the
previous line indices will refer to different lines; therefore we need
to offset them.
This commit is contained in:
Daniel Bertalan 2021-06-05 16:46:33 +02:00 committed by Andreas Kling
parent 13991eade7
commit ce9460de59
7 changed files with 23 additions and 10 deletions

View file

@ -42,6 +42,12 @@ public:
m_end = end;
}
void offset_row(int delta)
{
m_start = Position(m_start.row() + delta, m_start.column());
m_end = Position(m_end.row() + delta, m_end.column());
}
bool operator==(const Range& other) const
{
return m_start == other.m_start && m_end == other.m_end;