summaryrefslogtreecommitdiff
path: root/src/window.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-11-24 16:36:37 +0800
committerMaxime Coste <mawww@kakoune.org>2017-11-24 16:36:37 +0800
commit5a0332ac87dcdab1f811d99599fac58cbc548272 (patch)
tree4d90a77e4601c260b24689da85618715ecd64f11 /src/window.cc
parent74b0c98769872303ee2afeffdc4a8c1080a0c4b3 (diff)
Window: fix buffer_coord when a line buffer range is empty
Fixes #1711
Diffstat (limited to 'src/window.cc')
-rw-r--r--src/window.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window.cc b/src/window.cc
index 76cb10cb..3e6ba661 100644
--- a/src/window.cc
+++ b/src/window.cc
@@ -260,7 +260,8 @@ BufferCoord find_buffer_coord(const DisplayLine& line, const Buffer& buffer,
}
column -= len;
}
- return buffer.clamp(buffer.prev(range.end));
+ return range.end == BufferCoord{0,0} ?
+ range.end : buffer.prev(range.end);
}
}