From 63d4c8c3114862a49a2a4a54b2f229f9260bf291 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 4 Jul 2018 19:42:32 +1000 Subject: Change `a` on end of line behaviour to be consistent `a` will just jump on next line, `a` on last end of line opens a new line beneath it. Fixes #1164 --- src/selection.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/selection.cc') diff --git a/src/selection.cc b/src/selection.cc index c8ab543b..c245095d 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -357,11 +357,7 @@ BufferCoord get_insert_pos(const Buffer& buffer, const Selection& sel, case InsertMode::InsertCursor: return sel.cursor(); case InsertMode::Append: - { - // special case for end of lines, append to current line instead - auto pos = sel.max(); - return buffer.byte_at(pos) == '\n' ? pos : buffer.char_next(pos); - } + return buffer.char_next(sel.max()); case InsertMode::InsertAtLineBegin: return sel.min().line; case InsertMode::AppendAtLineEnd: -- cgit v1.2.3