diff options
Diffstat (limited to 'src/buffer_utils.hh')
| -rw-r--r-- | src/buffer_utils.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index 8e7fe5dc..543e2357 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -37,6 +37,15 @@ inline bool is_eol(const Buffer& buffer, ByteCoord coord) return buffer.is_end(coord) or buffer[coord.line].length() == coord.column+1; } +inline bool is_bow(const Buffer& buffer, ByteCoord coord) +{ + auto it = utf8::iterator<BufferIterator>(buffer.iterator_at(coord), buffer); + if (coord == ByteCoord{0,0}) + return is_word(*it); + + return not is_word(*(it-1)) and is_word(*it); +} + inline bool is_eow(const Buffer& buffer, ByteCoord coord) { if (buffer.is_end(coord) or coord == ByteCoord{0,0}) |
