diff options
-rw-r--r-- | ranger/container/commandlist.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ranger/container/commandlist.py b/ranger/container/commandlist.py index e66871ea..c40d0a5b 100644 --- a/ranger/container/commandlist.py +++ b/ranger/container/commandlist.py @@ -132,11 +132,14 @@ class CommandList(object): existing = self._str_to_tuple(existing) new = tuple(map(self._str_to_tuple, new)) - cmd = self.paths[existing] - - for key in new: - self.paths[key] = cmd - cmd.keys |= set([key]) + try: + cmd = self.paths[existing] + except KeyError: + self.unbind(*new) + else: + for key in new: + self.paths[key] = cmd + cmd.keys |= set([key]) def unbind(self, *keys): i = len(self.commandlist) |