From a7309fbe87f02591b709e769962d0859482b1053 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 21 Nov 2011 22:18:00 +0000 Subject: [PATCH] IncrementalInserter: fix erase --- src/window.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window.cc b/src/window.cc index 17d3904b..906258be 100644 --- a/src/window.cc +++ b/src/window.cc @@ -437,8 +437,10 @@ void IncrementalInserter::insert_capture(size_t index) void IncrementalInserter::erase() { - move_cursor(DisplayCoord(0, -1)); + for (auto& sel : m_window.m_selections) + sel = Selection(sel.first() - 1, sel.last() - 1); m_window.erase_noundo(); + m_window.scroll_to_keep_cursor_visible_ifn(); } void IncrementalInserter::move_cursor(const DisplayCoord& offset)