Fix bug when deleting end of buffer text using multiple selections

This commit is contained in:
Maxime Coste 2015-01-23 19:12:15 +00:00
parent 02adf234b4
commit f4e96e7f2e
4 changed files with 18 additions and 0 deletions

View File

@ -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();
}

View File

@ -0,0 +1 @@
%<a-s><a-K>keep<ret>d

View File

@ -0,0 +1,6 @@
delete
keep
delete
keep
delete
delete

View File

@ -0,0 +1,2 @@
keep
keep