diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 3 | ||||
| -rw-r--r-- | src/normal.cc | 10 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/main.cc b/src/main.cc index e98a09b4..555f5eba 100644 --- a/src/main.cc +++ b/src/main.cc @@ -47,7 +47,8 @@ static const char* startup_info = " * Regex implementation switched to a custom one, the syntax is slightly\n" " less tolerant.\n" " * ModeChange hook has been introduced and is expected to replace\n" -" the various ${MODE}Begin/${MODE}End hooks, consider those deprecated.\n"; +" the various ${MODE}Begin/${MODE}End hooks, consider those deprecated.\n" +" * '*' Does not strip whitespaces anymore\n"; struct startup_error : runtime_error { diff --git a/src/normal.cc b/src/normal.cc index d890ab7d..86c49e00 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -838,15 +838,7 @@ void use_selection_as_search_pattern(Context& context, NormalParams params) const auto& buffer = context.buffer(); for (auto& sel : sels) { - auto beg = sel.min(), end = sel.max(); - if (smart) // skip whitespaces - { - while (is_blank(buffer.byte_at(beg)) and beg != end) - beg = buffer.char_next(beg); - while (is_blank(buffer.byte_at(end)) and beg != end) - end = buffer.char_prev(end); - } - end = buffer.char_next(end); + const auto beg = sel.min(), end = buffer.char_next(sel.max()); patterns.push_back(format("{}\\Q{}\\E{}", smart and is_bow(buffer, beg) ? "\\b" : "", buffer.string(beg, end), |
