From ffbc0e2a1d66e5a6ac69ca521b8b442e24f81552 Mon Sep 17 00:00:00 2001 From: toonn Date: Thu, 31 Dec 2020 16:26:36 +0100 Subject: Only write tags if they might've changed --- ranger/container/tags.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: -- cgit 1.4.1-2-gfad0