From fc7f017372f002680cf8a631ba88b8d200adcf6d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 5 Jul 2014 12:37:49 +0100 Subject: [PATCH] Remove 'ReplaceMain' select mode --- src/normal.cc | 12 ------------ 1 file changed, 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 @@ -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(buffer, sel, regex)); } - else if (mode == SelectMode::ReplaceMain) - selections.main() = find_next_match(buffer, selections.main(), regex); else if (mode == SelectMode::Append) { selections.push_back(find_next_match(buffer, selections.main(), regex));