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:
Maxime Coste 2018-10-08 12:35:24 +11:00
parent eba40028b9
commit ed84a2d60c
4 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -0,0 +1 @@
x*n

View File

@ -0,0 +1,3 @@
a
%(a)

View File

@ -0,0 +1 @@
1.1,1.2