summaryrefslogtreecommitdiff
path: root/src/editor.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-11-26 19:24:38 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-11-26 19:24:38 +0100
commitcad4d3c01edd47bdb9dccd6b9998e0d9eaa4c65c (patch)
tree5376372350681512a05545cf6f3ac33adffac55e /src/editor.cc
parentcee0a2d128bb843cd4a65dcddb66188ea825553e (diff)
fix InsertMode::OpenLineBelow behaviour in prepare_insert
Diffstat (limited to 'src/editor.cc')
-rw-r--r--src/editor.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/editor.cc b/src/editor.cc
index 7ad9b610..1d0d7d0e 100644
--- a/src/editor.cc
+++ b/src/editor.cc
@@ -54,9 +54,9 @@ static BufferIterator prepare_insert(Buffer& buffer, const Selection& sel,
return buffer.iterator_at_line_end(sel.end()-1);
case InsertMode::OpenLineBelow:
{
- auto pos = buffer.iterator_at_line_end(sel.end() - 1);
- buffer.insert(pos, "\n");
- return buffer.iterator_at_line_begin(pos.line() + 1);
+ LineCount line = (sel.end() - 1).line();
+ buffer.insert(buffer.iterator_at_line_end(line), "\n");
+ return buffer.iterator_at_line_begin(line + 1);
}
case InsertMode::OpenLineAbove:
{