From 3a34fae9a79bf9aa2b0d840606f8adbc41760a4c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 Nov 2012 13:37:29 +0100 Subject: [PATCH] Editor: avoid end of lines when moving selection --- src/editor.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor.cc b/src/editor.cc index 98c18410..a544bae7 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -133,6 +133,7 @@ void Editor::move_selections(CharCount offset, SelectMode mode) : utf8::previous(buffer().iterator_at_line_end(last)); last = utf8::advance(last, limit, offset); sel.selection = Selection(mode == SelectMode::Extend ? sel.first() : last, last); + sel.selection.avoid_eol(); } merge_overlapping(m_selections); } @@ -146,6 +147,7 @@ void Editor::move_selections(LineCount offset, SelectMode mode) pos.line += offset; BufferIterator last = utf8::finish(m_buffer->iterator_at(pos, true)); sel.selection = Selection(mode == SelectMode::Extend ? sel.first() : last, last); + sel.selection.avoid_eol(); } merge_overlapping(m_selections); }