Change word object selector to fail if the cursor is not on a word char

This commit is contained in:
Maxime Coste 2017-03-04 17:43:44 +00:00
parent 887232987c
commit cc88b0f586
4 changed files with 1 additions and 7 deletions

View File

@ -120,10 +120,7 @@ select_word(const Buffer& buffer, const Selection& selection,
int count, ObjectFlags flags)
{
Utf8Iterator first{buffer.iterator_at(selection.cursor()), buffer};
if (not is_word<word_type>(*first) and
((flags & ObjectFlags::Inner) or
not skip_while(first, buffer.end(), [](Codepoint c)
{ return not is_word<word_type>(c); })))
if (not is_word<word_type>(*first))
return {};
Utf8Iterator last = first;

View File

@ -1 +0,0 @@
<a-a>w

View File

@ -1 +0,0 @@
foo%( )bar baz

View File

@ -1 +0,0 @@
bar