diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 20:56:27 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 20:56:49 +0100 |
| commit | 4e280977a2fcd7ca423b5909b435b896b256cdaf (patch) | |
| tree | caf34647ab26f749f5c63f5af71f34302bc5e261 /src/buffer_utils.hh | |
| parent | c3f4ef9ba2e8ca58acc6cf56e552341a5af62f5d (diff) | |
Iterate in reversed order on selections when modifing buffer
This way, update only needs to be called once everything is done
as we always modify after the next selection to be used.
Diffstat (limited to 'src/buffer_utils.hh')
| -rw-r--r-- | src/buffer_utils.hh | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index bd617595..f47c2c26 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -24,20 +24,6 @@ inline CharCount char_length(const Buffer& buffer, const Selection& range) utf8::next(buffer.iterator_at(range.max()))); } -inline void avoid_eol(const Buffer& buffer, ByteCoord& coord) -{ - const auto column = coord.column; - const auto& line = buffer[coord.line]; - if (column != 0 and column == line.length() - 1) - coord.column = line.byte_count_to(line.char_length() - 2); -} - -inline void avoid_eol(const Buffer& buffer, Selection& sel) -{ - avoid_eol(buffer, sel.anchor()); - avoid_eol(buffer, sel.cursor()); -} - CharCount get_column(const Buffer& buffer, CharCount tabstop, ByteCoord coord); |
