From 77adddb6d19a69b25c4077af8b3d878c4ad9c439 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 16 Apr 2025 18:11:53 +0300 Subject: curses: minor cleanup - avoid preprocessor statements --- src/interface-curses/interface.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index e9099ce..a71ca20 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -2074,7 +2074,12 @@ teco_interface_event_loop_iter(void) /* ANY of the mouse events */ if (!teco_interface_getmouse(error)) return; - break; + /* + * Do not auto-scroll on mouse events, so you can scroll the view manually + * in the ^KMOUSE macro, allowing dot to be outside of the view. + */ + teco_interface_refresh(); + return; #endif /* @@ -2126,17 +2131,7 @@ teco_interface_event_loop_iter(void) * Instead we do it only once after almost every keypress. * If possible, the vertical scrolling position is preserved, which helps * for instance if the buffer contents are deleted and restored later on. - * - * The only exception is mouse events, so you can scroll the view manually - * in the ^KMOUSE macro, allowing dot to be outside of the view. */ -#if NCURSES_MOUSE_VERSION >= 2 - if (key == KEY_MOUSE) { - teco_interface_refresh(); - return; - } -#endif - if (teco_interface_current_view == last_view) teco_interface_ssm(SCI_SETFIRSTVISIBLELINE, last_vpos, 0); teco_interface_ssm(SCI_SCROLLCARET, 0, 0); -- cgit v1.2.3