summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-05-04 06:39:03 +0000
committerMaxime Coste <frrrwww@gmail.com>2012-05-04 06:39:03 +0000
commitdd7228b098513a920aefaf356a362f07ce1fc520 (patch)
treed28ed584be66b885f708b5ff2a94eddae36585f5 /src/display_buffer.cc
parentebe945f344446d0b4305b8bef8f7c4268dce6739 (diff)
fix DisplayBuffer::atom_containing when where is before first atom
Diffstat (limited to 'src/display_buffer.cc')
-rw-r--r--src/display_buffer.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index 133c843f..2ecded59 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -93,6 +93,9 @@ DisplayBuffer::iterator DisplayBuffer::atom_containing(const BufferIterator& whe
DisplayBuffer::iterator DisplayBuffer::atom_containing(const BufferIterator& where,
iterator start)
{
+ if (where < start->begin())
+ return end();
+
return std::upper_bound(start, end(), where,
[](const BufferIterator& where, const DisplayAtom& atom)
{ return where < atom.end(); });