[geany/geany-plugins] fe69f7: git-ui: Don't spit out critical warnings under normal circumstances

Colomban Wendling git-noreply at xxxxx
Wed Feb 18 08:38:26 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 21 Jan 2015 16:01:42 UTC
Commit:      fe69f7504e33a2a1913f7502cc459cbe029f3eab
             https://github.com/geany/geany-plugins/commit/fe69f7504e33a2a1913f7502cc459cbe029f3eab

Log Message:
-----------
git-ui: Don't spit out critical warnings under normal circumstances

Apparently what was introduced as a defensive check catches an actual
legitimate case, so transform it to a normal check.


Modified Paths:
--------------
    git-ui/src/ggu-plugin.c

Modified: git-ui/src/ggu-plugin.c
6 lines changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -593,7 +593,11 @@ on_sci_query_tooltip (GtkWidget  *widget,
   GeanyDocument    *doc         = document_get_current ();
   gboolean          has_tooltip = FALSE;
   
-  g_return_val_if_fail (doc && doc->editor->sci == sci, FALSE);
+  /* for some reason the widget isn't the current one during tab switch, so
+   * give up silently when we receive a query for a non-current widget */
+  if (! doc || doc->editor->sci != sci) {
+    return FALSE;
+  }
   
   min_x = scintilla_send_message (sci, SCI_GETMARGINWIDTHN, 0, 0);
   max_x = min_x + scintilla_send_message (sci, SCI_GETMARGINWIDTHN, 1, 0);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list