summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-15 18:27:59 +0200
committerhut <hut@lavabit.com>2010-05-15 18:27:59 +0200
commit72545b1b7b982ca282e0dc4f2361d3abba727b48 (patch)
treeec8cfd994985fc12fd2e852cc2a0b798d83dd7c6
parent1405a397efadf6d3f93d570025d384445b531009 (diff)
downloadranger-72545b1b7b982ca282e0dc4f2361d3abba727b48.tar.gz
core.actions: Fixed bug where you can't use "h" to leave a loading dir
-rw-r--r--ranger/core/actions.py40
1 files changed, 18 insertions, 22 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index e1346612..7c996895 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -109,9 +109,6 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		self.move(to=1, percentage=True)  # moves to 80%
 		"""
 		cwd = self.env.cwd
-		if not cwd or not cwd.accessible or not cwd.content_loaded:
-			return
-
 		direction = Direction(kw)
 		if 'left' in direction or direction.left() > 0:
 			steps = direction.left()
@@ -122,25 +119,24 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			except:
 				return
 			self.env.enter_dir(directory)
-
-		elif 'right' in direction:
-			mode = 0
-			if narg is not None:
-				mode = narg
-			cf = self.env.cf
-			selection = self.env.get_selection()
-			if not self.env.enter_dir(cf) and selection:
-				if self.execute_file(selection, mode=mode) is False:
-					self.open_console(cmode.OPEN_QUICK)
-
-		elif direction.vertical():
-			newpos = direction.move(
-					direction=direction.down(),
-					override=narg,
-					maximum=len(cwd),
-					current=cwd.pointer,
-					pagesize=self.ui.browser.hei)
-			cwd.move(to=newpos)
+		if cwd and cwd.accessible and cwd.content_loaded:
+			if 'right' in direction:
+				mode = 0
+				if narg is not None:
+					mode = narg
+				cf = self.env.cf
+				selection = self.env.get_selection()
+				if not self.env.enter_dir(cf) and selection:
+					if self.execute_file(selection, mode=mode) is False:
+						self.open_console(cmode.OPEN_QUICK)
+			elif direction.vertical():
+				newpos = direction.move(
+						direction=direction.down(),
+						override=narg,
+						maximum=len(cwd),
+						current=cwd.pointer,
+						pagesize=self.ui.browser.hei)
+				cwd.move(to=newpos)
 
 	def move_parent(self, n):
 		self.enter_dir('..')