diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-10-10 14:28:39 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-10-10 14:28:39 +0000 |
| commit | fe0e1c79f05cee628b82a2b2f655d873ed922a78 (patch) | |
| tree | 2ac763a796a2728c5c01f7d62a2881fb1d4aaf7d /src | |
| parent | 7e84ca9ae970b2a3a314946ae4890d3a986f374d (diff) | |
Window: scroll when inserting, appending, erasing if necessary
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.cc | 3 |
1 files changed, 3 insertions, 0 deletions
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() |
