From 20a2bca52e0d159cdbab4ff6d38024cd1503a4f5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 27 Aug 2023 08:05:46 +1000 Subject: Do not make cursor visible after mouse scrolling and view commands ensure cursor is visible after user input except if the command implementation opted-out. Hooks and timers should not enforce visible cursor. PageUp/PageDown and `` / `` commands still move the cursor as this seemed a desired behaviour. --- src/input_handler.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/input_handler.hh') diff --git a/src/input_handler.hh b/src/input_handler.hh index 00d2d53a..afcc24d4 100644 --- a/src/input_handler.hh +++ b/src/input_handler.hh @@ -204,7 +204,13 @@ void on_next_key_with_autoinfo(const Context& context, StringView mode_name, }); } -void scroll_window(Context& context, LineCount offset, bool mouse_dragging = false); +enum class OnHiddenCursor { + PreserveSelections, + MoveCursor, + MoveCursorAndAnchor, +}; + +void scroll_window(Context& context, LineCount offset, OnHiddenCursor on_hidden_cursor); } -- cgit v1.2.3