From 62eb87b149166588d766d5a272e5232ecf86be5d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 2 May 2025 07:33:28 +0300 Subject: auto-expand folds even after mouse events The ^KMOUSE macro can also change dot and it was possible to place dot into invisible areas at the end of the document. --- src/interface-curses/interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interface-curses/interface.c') diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index e3013fb..bccc90d 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -2078,6 +2078,7 @@ teco_interface_event_loop_iter(void) * 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_unfold(); teco_interface_refresh(); return; #endif @@ -2134,9 +2135,7 @@ teco_interface_event_loop_iter(void) */ if (teco_interface_current_view == last_view) teco_interface_ssm(SCI_SETFIRSTVISIBLELINE, last_vpos, 0); - /* also unfold automatically */ - sptr_t dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); - teco_interface_ssm(SCI_ENSUREVISIBLE, teco_interface_ssm(SCI_LINEFROMPOSITION, dot, 0), 0); + teco_interface_unfold(); teco_interface_ssm(SCI_SCROLLCARET, 0, 0); teco_interface_refresh(); -- cgit v1.2.3