From fe0e1c79f05cee628b82a2b2f655d873ed922a78 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 10 Oct 2011 14:28:39 +0000 Subject: [PATCH] Window: scroll when inserting, appending, erasing if necessary --- src/window.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/window.cc b/src/window.cc index 169a8b09..ef797247 100644 --- a/src/window.cc +++ b/src/window.cc @@ -140,6 +140,7 @@ void Window::erase_noundo() m_buffer.erase(sel.begin(), sel.end()); sel = Selection(sel.begin(), sel.begin()); } + scroll_to_keep_cursor_visible_ifn(); } static WindowCoord measure_string(const Window::String& string) @@ -171,6 +172,7 @@ void Window::insert_noundo(const String& string) m_buffer.insert(sel.begin(), string); sel.offset(string.length()); } + scroll_to_keep_cursor_visible_ifn(); } void Window::append(const String& string) @@ -183,6 +185,7 @@ void Window::append_noundo(const String& string) { for (auto& sel : m_selections) m_buffer.insert(sel.end(), string); + scroll_to_keep_cursor_visible_ifn(); } bool Window::undo()