summaryrefslogtreecommitdiff
path: root/src/editor.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-02-27 21:09:40 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-02-27 21:09:48 +0100
commit4ad8941563bc593687586871c7d69be66600ece5 (patch)
treeb41c680b15d9a73a183bca30cb1b19ad18b9ef42 /src/editor.cc
parent8606fdae5dc5a163bce42761a4d1716df243af9c (diff)
Editor: fix move_selection(LineCount) when current column is after next line end
Diffstat (limited to 'src/editor.cc')
-rw-r--r--src/editor.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/editor.cc b/src/editor.cc
index 6f3255ed..9c553dec 100644
--- a/src/editor.cc
+++ b/src/editor.cc
@@ -181,7 +181,7 @@ void Editor::move_selections(LineCount offset, SelectMode mode)
CharCount column = utf8::distance(m_buffer->iterator_at_line_begin(pos.line), sel.last());
pos.line += offset;
BufferIterator last = utf8::advance(m_buffer->iterator_at_line_begin(pos.line),
- m_buffer->iterator_at_line_end(pos.line), column);
+ m_buffer->iterator_at_line_end(pos.line)-1, column);
sel.first() = mode == SelectMode::Extend ? sel.first() : last;
sel.last() = last;
sel.avoid_eol();