diff options
author | toonn <toonn@toonn.io> | 2020-12-31 16:26:36 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2020-12-31 19:02:56 +0100 |
commit | ffbc0e2a1d66e5a6ac69ca521b8b442e24f81552 (patch) | |
tree | 00ab83fa37ff21a22f2b55c7a10f2e4315cf4b5b /ranger | |
parent | 0e02abbe5b8f218f6d429be44759322dc086bca9 (diff) | |
download | ranger-ffbc0e2a1d66e5a6ac69ca521b8b442e24f81552.tar.gz |
Only write tags if they might've changed
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/tags.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/container/tags.py b/ranger/container/tags.py index d73b1cf1..e43fcb78 100644 --- a/ranger/container/tags.py +++ b/ranger/container/tags.py @@ -30,6 +30,8 @@ class Tags(FileManagerAware): return item in self.tags def add(self, *items, **others): + if len(*items) == 0: + return tag = others.get('tag', self.default_tag) self.sync() for item in items: @@ -37,6 +39,8 @@ class Tags(FileManagerAware): self.dump() def remove(self, *items): + if len(*items) == 0: + return self.sync() for item in items: try: @@ -46,6 +50,8 @@ class Tags(FileManagerAware): self.dump() def toggle(self, *items, **others): + if len(*items) == 0: + return tag = others.get('tag', self.default_tag) tag = str(tag) if tag not in ALLOWED_KEYS: |