diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-15 20:52:57 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-15 20:52:57 +0000 |
| commit | f83d5672f830d49e9ff9fa2f5df8144d0e362e56 (patch) | |
| tree | 65d38c6e50a821ce6fb365a65a817ade60646556 /src/selection.hh | |
| parent | ea95632709a6ae3df76772e83e1497a9fcfee52d (diff) | |
Fix replace_with_char behaviour, keep the same selections
Diffstat (limited to 'src/selection.hh')
| -rw-r--r-- | src/selection.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/selection.hh b/src/selection.hh index e8278625..aad74f95 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -51,6 +51,13 @@ inline BufferIterator erase(Buffer& buffer, const Range& range) utf8::next(buffer.iterator_at(range.max()))); } +inline CharCount char_length(const Buffer& buffer, const Range& range) +{ + return utf8::distance(buffer.iterator_at(range.min()), + utf8::next(buffer.iterator_at(range.max()))); +} + + inline void avoid_eol(const Buffer& buffer, BufferCoord& coord) { const auto column = coord.column; |
