summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-07-05 12:37:49 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-07-05 12:37:49 +0100
commitfc7f017372f002680cf8a631ba88b8d200adcf6d (patch)
tree4176bcae103769911cdc5076eb1de8127fbac4a6 /src/normal.cc
parenta61db7ef5ecc44f05a47514394475e9023cb79fa (diff)
Remove 'ReplaceMain' select mode
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 6710802e..e4c5995d 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -27,7 +27,6 @@ enum class SelectMode
Replace,
Extend,
Append,
- ReplaceMain,
};
template<SelectMode mode = SelectMode::Replace, typename Func>
@@ -44,15 +43,6 @@ void select(Context& context, Func func)
selections.push_back(res);
selections.set_main_index(selections.size() - 1);
}
- else if (mode == SelectMode::ReplaceMain)
- {
- auto& sel = selections.main();
- auto res = func(buffer, sel);
- sel.anchor() = res.anchor();
- sel.cursor() = res.cursor();
- if (not res.captures().empty())
- sel.captures() = std::move(res.captures());
- }
else
{
for (auto& sel : selections)
@@ -429,8 +419,6 @@ void select_next_match(const Buffer& buffer, SelectionList& selections,
for (auto& sel : selections)
sel.merge_with(find_next_match<direction>(buffer, sel, regex));
}
- else if (mode == SelectMode::ReplaceMain)
- selections.main() = find_next_match<direction>(buffer, selections.main(), regex);
else if (mode == SelectMode::Append)
{
selections.push_back(find_next_match<direction>(buffer, selections.main(), regex));