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-gtk/interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interface-gtk/interface.c') diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c index 06abe61..9241767 100644 --- a/src/interface-gtk/interface.c +++ b/src/interface-gtk/interface.c @@ -1416,6 +1416,8 @@ teco_interface_input_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) teco_interrupted = FALSE; teco_interface_refresh(teco_interface_current_view != last_view); + /* always expand folds, even after mouse clicks */ + teco_interface_unfold(); /* * Scintilla has been patched to avoid any automatic scrolling since that * has been benchmarked to be a very costly operation. @@ -1429,9 +1431,6 @@ teco_interface_input_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) if (event->type == GDK_KEY_PRESS) { 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_ssm(SCI_SCROLLCARET, 0, 0); } -- cgit v1.2.3