summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-10-03 20:01:37 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-10-03 20:01:37 +0100
commita51d5a10469bc5a555c58745f1f61880990ea4f7 (patch)
treebcf19b8d22da88c863367ecc70ac5b50eae17ca9 /src
parentc7356c8e9c28de0f76895a0436246a462b3f98e2 (diff)
Do not select the next word for inner word.
Diffstat (limited to 'src')
-rw-r--r--src/selectors.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/selectors.hh b/src/selectors.hh
index 74f0d198..462b188f 100644
--- a/src/selectors.hh
+++ b/src/selectors.hh
@@ -149,8 +149,9 @@ Selection select_word(const Buffer& buffer, const Selection& selection,
{
Utf8Iterator first{buffer.iterator_at(selection.cursor()), buffer};
if (not is_word<word_type>(*first) and
- not skip_while(first, buffer.end(), [](Codepoint c)
- { return not is_word<word_type>(c); }))
+ ((flags & ObjectFlags::Inner) or
+ not skip_while(first, buffer.end(), [](Codepoint c)
+ { return not is_word<word_type>(c); })))
return selection;
Utf8Iterator last = first;