Merge remote-tracking branch 'potatoalienof13/fix-buffer-advance'

This commit is contained in:
Maxime Coste 2023-01-18 07:47:23 +11:00
commit 029b28a85c

View File

@ -575,9 +575,9 @@ BufferCoord Buffer::advance(BufferCoord coord, ByteCount count) const
count += coord.column; count += coord.column;
while (count < 0) while (count < 0)
{ {
count += m_lines[--line].length(); if (--line < 0)
if (line < 0)
return {0, 0}; return {0, 0};
count += m_lines[line].length();
} }
return { line, count }; return { line, count };
} }