summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2015-10-23 01:05:57 +0200
committernfnty <git@nfnty.se>2016-02-08 04:43:04 +0100
commitcf750b5b890d3dd903116459eb621fae1875a5c6 (patch)
tree63fe07e0b633c17a2b90e94e449cfd8d8b053c5d
parent5741db319e4f7a78045cfcc6cb0ac95919bc0a4c (diff)
downloadranger-cf750b5b890d3dd903116459eb621fae1875a5c6.tar.gz
VCS: Only redraw when awoken
-rw-r--r--ranger/ext/vcs/vcs.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index 2815916a..ca16fbbf 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -360,19 +360,18 @@ class VcsThread(threading.Thread):
         self.delay = idle_delay / 1000
         self.wake = threading.Event()
 
-    def _is_flat(self):
-        """Check for flat mode"""
+    def _check(self):
+        """Check for hinders"""
         for column in self.ui.browser.columns:
             if column.target and column.target.is_directory and column.target.flat:
                 return True
         return False
 
     def run(self):
-        # Set for already updated roots
-        roots = set()
+        roots = set() # already updated roots
         redraw = False
         while True:
-            if self._is_flat():
+            if self._check():
                 self.wake.wait(timeout=self.delay)
                 self.wake.clear()
                 continue
@@ -401,11 +400,12 @@ class VcsThread(threading.Thread):
                     if column.target and column.target.is_directory:
                         column.need_redraw = True
                 self.ui.status.need_redraw = True
-                self.ui.redraw()
+                if self.wake.is_set():
+                    self.ui.redraw()
 
             roots.clear()
-            self.wake.wait(timeout=self.delay)
             self.wake.clear()
+            self.wake.wait(timeout=self.delay)
 
     def wakeup(self):
         """Wakeup thread"""