diff options
Diffstat (limited to 'src/buffer_utils.hh')
| -rw-r--r-- | src/buffer_utils.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index a8226660..58192f31 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -31,6 +31,11 @@ inline CharCount char_length(const Buffer& buffer, const Selection& range) buffer.iterator_at(buffer.char_next(range.max()))); } +inline CharCount char_length(const Buffer& buffer, const ByteCoord& begin, const ByteCoord& end) +{ + return utf8::distance(buffer.iterator_at(begin), buffer.iterator_at(end)); +} + inline bool is_bol(ByteCoord coord) { return coord.column == 0; |
