From e7a4d0ef3ae5c34a0b7ff9bc5b1466e700cc56a4 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 18 Aug 2011 21:03:06 -0400 Subject: Fixed split view focus bug with the same buffer in two views; src/textadept.c --- src/textadept.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/textadept.c b/src/textadept.c index f590bc90..67d76a79 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -521,10 +521,15 @@ static void switch_to_view(GtkWidget *editor) { static void s_notification(GtkWidget *editor, gint wParam, gpointer lParam, gpointer udata) { struct SCNotification *n = (struct SCNotification *)lParam; - if (focused_editor != editor && - (n->nmhdr.code == SCN_URIDROPPED || n->nmhdr.code == SCN_SAVEPOINTLEFT)) + if (focused_editor == editor || n->nmhdr.code == SCN_URIDROPPED) { + if (focused_editor != editor) switch_to_view(editor); + l_emit_scnnotification(n); + } else if (n->nmhdr.code == SCN_SAVEPOINTLEFT) { + GtkWidget *prev = focused_editor; switch_to_view(editor); - l_emit_scnnotification(n); + l_emit_scnnotification(n); + switch_to_view(prev); // do not let a split view steal focus + } } /** -- cgit v1.2.3