Buffer begin and end are not end-of-words
Buffer begin never has a word character before, and end is always preceeded by an end-of-line. Fixes #2420
This commit is contained in:
parent
eba40028b9
commit
ed84a2d60c
|
@ -63,7 +63,7 @@ inline bool is_bow(const Buffer& buffer, BufferCoord coord)
|
||||||
inline bool is_eow(const Buffer& buffer, BufferCoord coord)
|
inline bool is_eow(const Buffer& buffer, BufferCoord coord)
|
||||||
{
|
{
|
||||||
if (buffer.is_end(coord) or coord == BufferCoord{0,0})
|
if (buffer.is_end(coord) or coord == BufferCoord{0,0})
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
auto it = utf8::iterator<BufferIterator>(buffer.iterator_at(coord), buffer);
|
auto it = utf8::iterator<BufferIterator>(buffer.iterator_at(coord), buffer);
|
||||||
return is_word(*(it-1)) and not is_word(*it);
|
return is_word(*(it-1)) and not is_word(*it);
|
||||||
|
|
1
test/regression/2420-discrepancy-in-star-behaviour/cmd
Normal file
1
test/regression/2420-discrepancy-in-star-behaviour/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
x*n
|
3
test/regression/2420-discrepancy-in-star-behaviour/in
Normal file
3
test/regression/2420-discrepancy-in-star-behaviour/in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
a
|
||||||
|
|
||||||
|
%(a)
|
1
test/regression/2420-discrepancy-in-star-behaviour/state
Normal file
1
test/regression/2420-discrepancy-in-star-behaviour/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.1,1.2
|
Loading…
Reference in New Issue
Block a user