From ecf8047bcc61ac87e9745f2e8600785972ff84cb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 25 Sep 2014 13:29:53 +0100 Subject: Fix reverse search when extending --- src/normal.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 0c749e23..1de74b97 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -421,7 +421,7 @@ void select_next_match(const Buffer& buffer, SelectionList& selections, if (mode == SelectMode::Replace) { for (auto& sel : selections) - sel = find_next_match(buffer, sel, regex); + sel = keep_direction(find_next_match(buffer, sel, regex), sel); } if (mode == SelectMode::Extend) { @@ -430,7 +430,10 @@ void select_next_match(const Buffer& buffer, SelectionList& selections, } else if (mode == SelectMode::Append) { - selections.push_back(find_next_match(buffer, selections.main(), regex)); + auto sel = keep_direction( + find_next_match(buffer, selections.main(), regex), + selections.main()); + selections.push_back(std::move(sel)); selections.set_main_index(selections.size() - 1); } selections.sort_and_merge_overlapping(); -- cgit v1.2.3