diff options
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 7 |
1 files changed, 5 insertions, 2 deletions
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<direction>(buffer, sel, regex); + sel = keep_direction(find_next_match<direction>(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<direction>(buffer, selections.main(), regex)); + auto sel = keep_direction( + find_next_match<direction>(buffer, selections.main(), regex), + selections.main()); + selections.push_back(std::move(sel)); selections.set_main_index(selections.size() - 1); } selections.sort_and_merge_overlapping(); |
