Fix bug when deleting end of buffer text using multiple selections
This commit is contained in:
parent
02adf234b4
commit
f4e96e7f2e
|
@ -527,6 +527,15 @@ void SelectionList::erase()
|
|||
sel.anchor() = sel.cursor() = m_buffer->clamp(pos.coord());
|
||||
changes_tracker.update(*m_buffer, m_timestamp);
|
||||
}
|
||||
|
||||
ByteCoord back_coord = m_buffer->back_coord();
|
||||
for (auto& sel : m_selections)
|
||||
{
|
||||
if (sel.anchor() > back_coord)
|
||||
sel.anchor() = back_coord;
|
||||
if (sel.cursor() > back_coord)
|
||||
sel.cursor() = back_coord;
|
||||
}
|
||||
m_buffer->check_invariant();
|
||||
}
|
||||
|
||||
|
|
1
test/compose/eof-multi-delete/cmd
Normal file
1
test/compose/eof-multi-delete/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
%<a-s><a-K>keep<ret>d
|
6
test/compose/eof-multi-delete/in
Normal file
6
test/compose/eof-multi-delete/in
Normal file
|
@ -0,0 +1,6 @@
|
|||
delete
|
||||
keep
|
||||
delete
|
||||
keep
|
||||
delete
|
||||
delete
|
2
test/compose/eof-multi-delete/out
Normal file
2
test/compose/eof-multi-delete/out
Normal file
|
@ -0,0 +1,2 @@
|
|||
keep
|
||||
keep
|
Loading…
Reference in New Issue
Block a user