summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-08-18 08:52:40 +0700
committerMaxime Coste <mawww@kakoune.org>2017-08-18 08:52:40 +0700
commit82d23bc400616989297953785da85cffc73cbc2c (patch)
treea4c601d2f3033a89c84bbc558ee679f51b1d4a34 /src
parent609a8ee8c793856b8c1e6b7c553ee3475ca8308f (diff)
Remove now trivial Selection::merge_with method
Diffstat (limited to 'src')
-rw-r--r--src/normal.cc4
-rw-r--r--src/selection.cc5
-rw-r--r--src/selection.hh2
3 files changed, 2 insertions, 9 deletions
diff --git a/src/normal.cc b/src/normal.cc
index fd44110f..78b134cf 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -63,7 +63,7 @@ void select(Context& context, T func)
}
if (mode == SelectMode::Extend)
- sel.merge_with(*res);
+ sel.cursor() = res->cursor();
else
{
sel.anchor() = res->anchor();
@@ -772,7 +772,7 @@ void search(Context& context, NormalParams params)
if (mode == SelectMode::Replace)
sel = keep_direction(find_next_match<direction>(context, sel, regex, wrapped), sel);
if (mode == SelectMode::Extend)
- sel.merge_with(find_next_match<direction>(context, sel, regex, wrapped));
+ sel.cursor() = find_next_match<direction>(context, sel, regex, wrapped).cursor();
}
selections.sort_and_merge_overlapping();
} while (--c > 0);
diff --git a/src/selection.cc b/src/selection.cc
index 43f47090..d55b3d20 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -7,11 +7,6 @@
namespace Kakoune
{
-void Selection::merge_with(const Selection& other)
-{
- m_cursor = other.m_cursor;
-}
-
SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp)
: m_buffer(&buffer), m_selections({ std::move(s) }), m_timestamp(timestamp)
{
diff --git a/src/selection.hh b/src/selection.hh
index 4b6269f3..1f492b43 100644
--- a/src/selection.hh
+++ b/src/selection.hh
@@ -20,8 +20,6 @@ struct Selection
: m_anchor{anchor}, m_cursor{cursor},
m_captures(std::move(captures)) {}
- void merge_with(const Selection& range);
-
BufferCoord& anchor() { return m_anchor; }
BufferCoordAndTarget& cursor() { return m_cursor; }