Package: gedit-source-code-browser-plugin / 3.0.3-5

0004-Try-to-load-symbols-on-draw-event.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Pietro Battiston <me@pietrobattiston.it>
Date: Mon, 12 May 2014 12:22:51 +0200
Subject: Try to load symbols on draw event

We must make sure that symbols are loaded for current document even
if the sourcetree does not get the focus: it is sufficient that it
is drawn.
---
 sourcecodebrowser/plugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sourcecodebrowser/plugin.py b/sourcecodebrowser/plugin.py
index 1ad81f6..8ce04df 100644
--- a/sourcecodebrowser/plugin.py
+++ b/sourcecodebrowser/plugin.py
@@ -332,7 +332,7 @@ class SourceCodeBrowserPlugin(GObject.Object, Gedit.WindowActivatable, PeasGtk.C
         panel = self.window.get_side_panel()
         panel.add_titled(self._sourcetree, "SymbolBrowserPlugin", "Source Code")
         self._handlers = []
-        hid = self._sourcetree.connect("focus", self.on_sourcetree_focus)
+        hid = self._sourcetree.connect("draw", self.on_sourcetree_draw)
         self._handlers.append((self._sourcetree, hid))
         if self.ctags_version is not None:
             hid = self._sourcetree.connect('tag-activated', self.on_tag_activated)
@@ -451,7 +451,7 @@ class SourceCodeBrowserPlugin(GObject.Object, Gedit.WindowActivatable, PeasGtk.C
             self._sourcetree.expanded_rows = {}
             self._load_active_document_symbols()
     
-    def on_sourcetree_focus(self, direction, data=None):
+    def on_sourcetree_draw(self, sourcetree, data=None):
         if not self._is_loaded:
             self._load_active_document_symbols()
         return False