summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-07 10:15:16 +0200
committerhut <hut@lavabit.com>2010-05-10 21:03:40 +0200
commit1dbc2fcedd9733c50d5a276201bd3d20b05f924e (patch)
tree0644e2892a9ebd6214e228e2de3b19ef6e449de5
parentc03637adfa243cc70b9de3e492669ae820a1ac6f (diff)
downloadranger-1dbc2fcedd9733c50d5a276201bd3d20b05f924e.tar.gz
api.commands: fixed :e
-rw-r--r--ranger/api/commands.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 73975adc..ca3f730d 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -48,13 +48,14 @@ class CommandContainer(object):
 	def get_command(self, name, abbrev=True):
 		if abbrev:
 			lst = [cls for cmd, cls in self.commands.items() \
-					if cmd.startswith(name) \
-					and cls.allow_abbrev \
+					if cls.allow_abbrev and cmd.startswith(name) \
 					or cmd == name]
 			if len(lst) == 0:
 				raise KeyError
-			if len(lst) == 1 or self.commands[name] in lst:
+			if len(lst) == 1:
 				return lst[0]
+			if self.commands[name] in lst:
+				return self.commands[name]
 			raise ValueError("Ambiguous command")
 		else:
 			try: