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:
parent
1688332d12
commit
609a8ee8c7
|
@ -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)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
|bar
|
|b
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
{
|
{
|
||||||
"foo
|
"f
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[
|
[
|
||||||
"foo
|
"f
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
|bar
|
|b
|
||||||
|
|
Loading…
Reference in New Issue
Block a user