about summary refs log tree commit diff stats
path: root/ranger/gui/widgets/console.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/gui/widgets/console.py')
-rw-r--r--ranger/gui/widgets/console.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index db92908b..22b9831d 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -245,17 +245,22 @@ class CommandConsole(ConsoleWithTab):
 		Console.execute(self)
 
 	def _get_cmd(self):
+		command_class = self._get_cmd_class()
+		if command_class:
+			return command_class(self.line, self.mode)
+		else:
+			return None
+
+	def _get_cmd_class(self):
 		try:
 			command_name = self.line.split()[0]
 		except IndexError:
 			return None
 
 		try:
-			command_class = commands.by_name[command_name]
+			return commands.by_name[command_name]
 		except KeyError:
 			return None
-
-		return command_class(self.line, self.mode)
 	
 	def _get_tab(self):
 		if ' ' in self.line: