IncrementalInserter: preserve captures
This commit is contained in:
parent
8bfb7da674
commit
030df1c4be
|
@ -413,7 +413,8 @@ IncrementalInserter::IncrementalInserter(Editor& editor, InsertMode mode)
|
||||||
--first;
|
--first;
|
||||||
if (last.underlying_iterator().is_end())
|
if (last.underlying_iterator().is_end())
|
||||||
--last;
|
--last;
|
||||||
sel = Selection(first.underlying_iterator(), last.underlying_iterator());
|
sel.first() = first.underlying_iterator();
|
||||||
|
sel.last() = last.underlying_iterator();
|
||||||
}
|
}
|
||||||
if (mode == InsertMode::OpenLineBelow or mode == InsertMode::OpenLineAbove)
|
if (mode == InsertMode::OpenLineBelow or mode == InsertMode::OpenLineAbove)
|
||||||
{
|
{
|
||||||
|
@ -424,7 +425,7 @@ IncrementalInserter::IncrementalInserter(Editor& editor, InsertMode mode)
|
||||||
{
|
{
|
||||||
// special case, the --first line above did nothing, so we need to compensate now
|
// special case, the --first line above did nothing, so we need to compensate now
|
||||||
if (sel.first() == utf8::next(buffer.begin()))
|
if (sel.first() == utf8::next(buffer.begin()))
|
||||||
sel = Selection(buffer.begin(), buffer.begin());
|
sel.first() = sel.last() = buffer.begin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user