summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-10-01 19:35:42 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-10-01 19:35:42 +0100
commit1cb4d2965fdb68e062f5a791af214bb7ec972cdb (patch)
tree0166cca43a7761a424a11a747826df9f61d95676 /src/normal.cc
parent77408becbd0ce84d22d6d0fd5bb1a47be824d559 (diff)
Fix '*' word boundary detection at begin/end of buffer
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/normal.cc b/src/normal.cc
index e0648abd..5eed5bcf 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -647,9 +647,9 @@ void use_selection_as_search_pattern(Context& context, NormalParams)
auto content = "\\Q" + buffer.string(begin.base().coord(), end.base().coord()) + "\\E";
if (smart)
{
- if (begin == buffer.begin() or (is_word(*begin) and not is_word(*(begin-1))))
+ if (is_word(*begin) and (begin == buffer.begin() or not is_word(*(begin-1))))
content = "\\b" + content;
- if (end == buffer.end() or (is_word(*(end-1)) and not is_word(*end)))
+ if (is_word(*(end-1)) and (end == buffer.end() or not is_word(*end)))
content = content + "\\b";
}
patterns.push_back(std::move(content));