Change selection extension code to be simpler

Selection extension now just keeps the anchor in place insead of
trying to be smart depending on the direction of selections.
This commit is contained in:
Maxime Coste 2017-08-18 08:49:37 +07:00
parent 1688332d12
commit 609a8ee8c7
6 changed files with 5 additions and 9 deletions

View File

@ -10,10 +10,6 @@ namespace Kakoune
void Selection::merge_with(const Selection& other) void Selection::merge_with(const Selection& other)
{ {
m_cursor = other.m_cursor; m_cursor = other.m_cursor;
if (m_anchor < m_cursor)
m_anchor = std::min(m_anchor, other.m_anchor);
if (m_anchor > m_cursor)
m_anchor = std::max(m_anchor, other.m_anchor);
} }
SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp) SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp)

View File

@ -1 +1 @@
|bar |b

View File

@ -1,2 +1,2 @@
{ {
"foo "f

View File

@ -1,2 +1,2 @@
[ [
"foo "f

View File

@ -1,2 +1,2 @@
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua incididunt ut labore et d

View File

@ -1 +1 @@
|bar |b