summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-01-22 03:52:14 +0100
committerhut <hut@lavabit.com>2013-01-22 03:52:14 +0100
commit8b1e75370d0285373342ed928e5929e31fb66616 (patch)
tree78dd705ef671e0fe96436cea325d105f7b43f4bc
parent11e123d17c082270600440d9894f19c3a7b60f6d (diff)
downloadranger-8b1e75370d0285373342ed928e5929e31fb66616.tar.gz
gui.displayable: turn "out of bounds" crashes into warnings
-rw-r--r--ranger/gui/displayable.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index cbd77fe4..28526d7a 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -153,19 +153,13 @@ class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts):
 				wid = maxx - x
 
 			if x < 0 or y < 0:
-				raise ValueError("Starting point below zero!")
+				self.fm.notify("Warning: Subwindow origin below zero for <%s> "
+					"(x = %d, y = %d)" % (self, x, y), bad=True)
 
-			#if wid < 1 or hei < 1:
-			#	raise OutOfBoundsException("WID and HEI must be >=1!")
-
-			if x + wid > maxx and y + hei > maxy:
-				raise ValueError("X and Y out of bounds!")
-
-			if x + wid > maxx:
-				raise ValueError("X out of bounds!")
-
-			if y + hei > maxy:
-				raise ValueError("Y out of bounds!")
+			if x + wid > maxx or y + hei > maxy:
+				self.fm.notify("Warning: Subwindow size out of bounds for <%s> "
+					"(x = %d, y = %d, hei = %d, wid = %d)" % (self,
+					x, y, hei, wid), bad=True)
 
 		window_is_cleared = False