From 8a4a3e447bb3c554ddd2b362b8fce1531a04c02e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 18 Sep 2011 20:09:25 +0000 Subject: [PATCH] Window: fix erase --- src/window.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/window.cc b/src/window.cc index 4cf5d60b0..f34abcece 100644 --- a/src/window.cc +++ b/src/window.cc @@ -24,9 +24,12 @@ void Window::erase() for (auto& sel : m_selections) { + sel.canonicalize(); m_buffer.erase(sel.begin(), sel.end()); sel = Selection(sel.begin(), sel.begin()); } + if (not m_selections.empty()) + m_cursor = line_and_column_at(m_selections.back().end()); m_buffer.end_undo_group(); }