summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-01-18 07:47:23 +1100
committerMaxime Coste <mawww@kakoune.org>2023-01-18 07:47:23 +1100
commit029b28a85cacded03eebcaf7dbd76102ac3350ed (patch)
treee9d09e49a0b64e187b2249e4e9037019f1602f80 /src
parent247e4885e81b6204e0af54d066f6e0c22b0dc2ad (diff)
parent293d46837d1d28e40f3d0ddf21c653aa616bbf40 (diff)
Merge remote-tracking branch 'potatoalienof13/fix-buffer-advance'
Diffstat (limited to 'src')
-rw-r--r--src/buffer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index fd8e0c4c..c968690f 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -575,9 +575,9 @@ BufferCoord Buffer::advance(BufferCoord coord, ByteCount count) const
count += coord.column;
while (count < 0)
{
- count += m_lines[--line].length();
- if (line < 0)
+ if (--line < 0)
return {0, 0};
+ count += m_lines[line].length();
}
return { line, count };
}