Change word object selector to fail if the cursor is not on a word char
This commit is contained in:
parent
887232987c
commit
cc88b0f586
|
@ -120,10 +120,7 @@ select_word(const Buffer& buffer, const Selection& selection,
|
||||||
int count, ObjectFlags flags)
|
int count, ObjectFlags flags)
|
||||||
{
|
{
|
||||||
Utf8Iterator first{buffer.iterator_at(selection.cursor()), buffer};
|
Utf8Iterator first{buffer.iterator_at(selection.cursor()), buffer};
|
||||||
if (not is_word<word_type>(*first) and
|
if (not is_word<word_type>(*first))
|
||||||
((flags & ObjectFlags::Inner) or
|
|
||||||
not skip_while(first, buffer.end(), [](Codepoint c)
|
|
||||||
{ return not is_word<word_type>(c); })))
|
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
Utf8Iterator last = first;
|
Utf8Iterator last = first;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<a-a>w
|
|
|
@ -1 +0,0 @@
|
||||||
foo%( )bar baz
|
|
|
@ -1 +0,0 @@
|
||||||
bar
|
|
Loading…
Reference in New Issue
Block a user