summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-14 16:34:34 +0200
committerhut <hut@lavabit.com>2010-04-14 16:34:34 +0200
commit7327aab14542763cdd1e135ed5317fccab1d51d4 (patch)
treef6b52a6ccf7c8f6520427544b344350ec0c09131 /ranger
parent8c364ad44cfdba9ce2dd6d2dd7e1885b3e433f66 (diff)
downloadranger-7327aab14542763cdd1e135ed5317fccab1d51d4.tar.gz
widgets.browsercolumn: added sanity check when clicking on preview
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/browsercolumn.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 0ef37ef1..7d38576d 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -95,20 +95,21 @@ class BrowserColumn(Pager):
 			pass
 
 		elif self.target.type is T_DIRECTORY:
-			index = self.scroll_begin + event.y - self.y
-
-			if event.pressed(1):
-				if not self.main_column:
-					self.fm.enter_dir(self.target.path)
-
-				if index < len(self.target):
-					self.fm.move_pointer(absolute = index)
-			elif event.pressed(3):
-				try:
-					clicked_file = self.target.files[index]
-					self.fm.enter_dir(clicked_file.path)
-				except:
-					pass
+			if self.target.accessible and self.target.content_loaded:
+				index = self.scroll_begin + event.y - self.y
+
+				if event.pressed(1):
+					if not self.main_column:
+						self.fm.enter_dir(self.target.path)
+
+					if index < len(self.target):
+						self.fm.move_pointer(absolute = index)
+				elif event.pressed(3):
+					try:
+						clicked_file = self.target.files[index]
+						self.fm.enter_dir(clicked_file.path)
+					except:
+						pass
 
 		else:
 			if self.level > 0: