fix DisplayBuffer::atom_containing when where is before first atom
This commit is contained in:
parent
ebe945f344
commit
dd7228b098
|
@ -93,6 +93,9 @@ DisplayBuffer::iterator DisplayBuffer::atom_containing(const BufferIterator& whe
|
||||||
DisplayBuffer::iterator DisplayBuffer::atom_containing(const BufferIterator& where,
|
DisplayBuffer::iterator DisplayBuffer::atom_containing(const BufferIterator& where,
|
||||||
iterator start)
|
iterator start)
|
||||||
{
|
{
|
||||||
|
if (where < start->begin())
|
||||||
|
return end();
|
||||||
|
|
||||||
return std::upper_bound(start, end(), where,
|
return std::upper_bound(start, end(), where,
|
||||||
[](const BufferIterator& where, const DisplayAtom& atom)
|
[](const BufferIterator& where, const DisplayAtom& atom)
|
||||||
{ return where < atom.end(); });
|
{ return where < atom.end(); });
|
||||||
|
|
Loading…
Reference in New Issue
Block a user