summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/display_buffer.cc')
-rw-r--r--src/display_buffer.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index 8ade4047..b7564550 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -113,7 +113,10 @@ DisplayLine::iterator DisplayLine::split(iterator it, ColumnCount count)
DisplayLine::iterator DisplayLine::split(BufferCoord pos)
{
- auto it = find_if(begin(), end(), [pos](const DisplayAtom& a) { return a.type() == DisplayAtom::Range and a.end() > pos; });
+ auto it = find_if(begin(), end(), [pos](const DisplayAtom& a) {
+ return (a.has_buffer_range() && a.begin() >= pos) ||
+ (a.type() == DisplayAtom::Range and a.end() > pos);
+ });
if (it == end() or it->begin() >= pos)
return it;
return ++split(it, pos);