summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2015-12-21 00:56:09 +0100
committernfnty <git@nfnty.se>2016-02-08 04:43:04 +0100
commit5374beaf5f5022a33889a7ebfa00fa9aaa07f670 (patch)
treef4978e0b0fbe1df5ed5a83c195031518e5483e7e /ranger
parent89a97553f9175ba6b007c594eb6f25a9310583cc (diff)
downloadranger-5374beaf5f5022a33889a7ebfa00fa9aaa07f670.tar.gz
VCS: Improve repodir detection
Diffstat (limited to 'ranger')
-rw-r--r--ranger/ext/vcs/vcs.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index fbcfc9c4..1c62afe7 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -345,6 +345,18 @@ class VcsThread(threading.Thread):
                 return True
         return False
 
+    def _targeted_directory_rightmost(self):
+        """Return rightmost targeted directory"""
+        target = self.ui.browser.columns[-1].target
+        if target:
+            if target.is_directory:
+                return target
+            else:
+                target = self.ui.browser.columns[-2].target
+                if target and target.is_directory:
+                    return target
+        return None
+
     def run(self):
         roots = set() # already updated roots
         redraw = False
@@ -354,6 +366,11 @@ class VcsThread(threading.Thread):
                 self.wake.clear()
                 continue
 
+            # Exclude root if repodir in the rightmost column (causes strobing)
+            target = self._targeted_directory_rightmost()
+            if target and target.vcs and target.vcs.in_repodir:
+                roots.add(target.vcs.root)
+
             for column in self.ui.browser.columns:
                 target = column.target
                 if target and target.is_directory and target.vcs:
@@ -362,12 +379,6 @@ class VcsThread(threading.Thread):
                         redraw = True
                     if target.vcs.track and target.vcs.root not in roots:
                         roots.add(target.vcs.root)
-                        # Do not update repo when repodir is displayed (causes strobing)
-                        if tuple(clmn for clmn in self.ui.browser.columns
-                                 if clmn.target
-                                 and (clmn.target.path == target.vcs.repodir or
-                                      clmn.target.path.startswith(target.vcs.repodir + '/'))):
-                            continue
                         lazy = target.vcs.REPOTYPES[target.vcs.repotype]['lazy']
                         if (target.vcs.rootvcs.status_subpaths is None \
                                 or (lazy and target.vcs.check_outdated()) \
@@ -375,6 +386,7 @@ class VcsThread(threading.Thread):
                                 and target.vcs.update_root():
                             target.vcs.update_tree()
                             redraw = True
+            roots.clear()
 
             if redraw:
                 redraw = False
@@ -385,7 +397,6 @@ class VcsThread(threading.Thread):
                 if self.wake.is_set():
                     self.ui.redraw()
 
-            roots.clear()
             self.wake.clear()
             self.wake.wait(timeout=self.delay)
 
Makefile?h=v1.6.0&id=cb116bf0dc119977f69f3146c786b09315ac9c50'>^
b06433bc ^
2c5ea01d ^
b0a216f5 ^

2c5ea01d ^
2c5ea01d ^
2c5ea01d ^
582f3519 ^
b06433bc ^
582f3519 ^

94c5d83e ^
dee6cfa6 ^
e9e4b4ff ^
b0a216f5 ^


e9e4b4ff ^





ad75190c ^
e9e4b4ff ^
e9e4b4ff ^
25a4162d ^
e9e4b4ff ^
fde932f2 ^
85fd5288 ^
4ade06a6 ^

85fd5288 ^
0c2c782d ^

636d9393 ^
b0a216f5 ^
b06433bc ^
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78