Editor: fix move_selection(LineCount) when current column is after next line end

This commit is contained in:
Maxime Coste 2013-02-27 21:09:40 +01:00
parent 8606fdae5d
commit 4ad8941563

View File

@ -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();