From 4e280977a2fcd7ca423b5909b435b896b256cdaf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 14 May 2014 20:56:27 +0100 Subject: 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. --- src/buffer_utils.hh | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/buffer_utils.hh') 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); -- cgit v1.2.3