From b245d80c4eb87c4aa931b6195983830e5cda8309 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 5 Dec 2011 19:21:16 +0000 Subject: [PATCH] Window: preserve current selection when empty multi_select --- src/window.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/window.cc b/src/window.cc index 498ea693..c0207cc7 100644 --- a/src/window.cc +++ b/src/window.cc @@ -247,8 +247,11 @@ void Window::multi_select(const MultiSelector& selector) std::copy(selections.begin(), selections.end(), std::back_inserter(new_selections)); } - m_selections = std::move(new_selections); - scroll_to_keep_cursor_visible_ifn(); + if (not new_selections.empty()) + { + m_selections = std::move(new_selections); + scroll_to_keep_cursor_visible_ifn(); + } } BufferString Window::selection_content() const