diff options
author | nfnty <git@nfnty.se> | 2015-12-28 11:27:35 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-02-08 04:43:04 +0100 |
commit | 69ac2c873254f82669471254ee6b174237957738 (patch) | |
tree | 48202f2bf56de6524a9171b90c837efc50701907 /ranger | |
parent | e7cde84822cf990501e2fbba60e3109829af7aa2 (diff) | |
download | ranger-69ac2c873254f82669471254ee6b174237957738.tar.gz |
VCS: Fix browsercolumn
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/vcs/vcs.py | 15 | ||||
-rw-r--r-- | ranger/gui/widgets/__init__.py | 28 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 14 |
3 files changed, 33 insertions, 24 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index b4009d62..d70af92d 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -354,14 +354,18 @@ class Vcs(object): def init_subroots(dirobj): """Initialize roots under dirobj""" redraw = False + has_vcschild = False + for fileobj in dirobj.files_all: if not fileobj.is_directory or not fileobj.vcs or not fileobj.vcs.track: continue - if fileobj.vcs.is_root and not fileobj.vcs.rootinit: - if fileobj.vcs.init_root(): - redraw = True + if fileobj.vcs.is_root: + has_vcschild = True + if not fileobj.vcs.rootinit: + fileobj.vcs.init_root() elif fileobj.is_link: if os.path.realpath(fileobj.path) == fileobj.vcs.root: + has_vcschild = True if not fileobj.vcs.rootvcs.rootinit: fileobj.vcs.rootvcs.init_root() fileobj.vcsstatus = fileobj.vcs.rootvcs.obj.vcsstatus @@ -370,6 +374,11 @@ def init_subroots(dirobj): fileobj.vcsstatus = fileobj.vcs.rootvcs.status_subpath( os.path.realpath(fileobj.path)) redraw = True + + if dirobj.has_vcschild != has_vcschild: + redraw = True + dirobj.has_vcschild = has_vcschild + return redraw class VcsThread(threading.Thread): diff --git a/ranger/gui/widgets/__init__.py b/ranger/gui/widgets/__init__.py index ca3e90ce..f61e18eb 100644 --- a/ranger/gui/widgets/__init__.py +++ b/ranger/gui/widgets/__init__.py @@ -6,24 +6,24 @@ class Widget(Displayable): """A class for classification of widgets.""" vcsstatus_symb = { - 'conflict': ('X', ["vcsconflict"]), - 'untracked': ('+', ["vcschanged"]), - 'deleted': ('-', ["vcschanged"]), - 'changed': ('*', ["vcschanged"]), - 'staged': ('*', ["vcsstaged"]), - 'ignored': ('·', ["vcsignored"]), - 'sync': ('√', ["vcssync"]), + 'conflict': ('X', ['vcsconflict']), + 'untracked': ('+', ['vcschanged']), + 'deleted': ('-', ['vcschanged']), + 'changed': ('*', ['vcschanged']), + 'staged': ('*', ['vcsstaged']), + 'ignored': ('·', ['vcsignored']), + 'sync': ('√', ['vcssync']), 'none': (' ', []), - 'unknown': ('?', ["vcsunknown"]), + 'unknown': ('?', ['vcsunknown']), } vcsremotestatus_symb = { - 'diverged': ('Y', ["vcsdiverged"]), - 'ahead': ('>', ["vcsahead"]), - 'behind': ('<', ["vcsbehind"]), - 'sync': ('=', ["vcssync"]), - 'none': ('⌂', ["vcsnone"]), - 'unknown': ('?', ["vcsunknown"]), + 'diverged': ('Y', ['vcsdiverged']), + 'ahead': ('>', ['vcsahead']), + 'behind': ('<', ['vcsbehind']), + 'sync': ('=', ['vcssync']), + 'none': ('⌂', ['vcsnone']), + 'unknown': ('?', ['vcsunknown']), } ellipsis = {False: '~', True: '…'} diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 944f5c58..07830b31 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -257,7 +257,7 @@ class BrowserColumn(Pager): metakey = hash(repr(sorted(metadata.items()))) if metadata else 0 key = (self.wid, selected_i == i, drawn.marked, self.main_column, drawn.path in copied, tagged_marker, drawn.infostring, - drawn.vcsstatus, drawn.vcsremotestatus, + drawn.vcsstatus, drawn.vcsremotestatus, self |