summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-06-28 16:19:47 +0200
committerhut <hut@lavabit.com>2012-06-28 16:19:47 +0200
commitb1e0855c39968593e2a599225e0b79c22b64e25f (patch)
treefb7de65548696362346fb27d8669d6ab532ccb95
parent13301b432b1b1459a440aead04a67110b9d25585 (diff)
downloadranger-b1e0855c39968593e2a599225e0b79c22b64e25f.tar.gz
Revert "gui.curses_shortcuts: partially reverted 0bb7e10b, it seems pointless"
The point of that commit was to not redraw stuff when using
addstr("foo") and it raises an exception.  Because You don't know where
drawing started and you end up writing "foo" twice - the second foo
starts at the place where the first one failed.

This reverts commit 5aac03b4b405d30c973fb9d853ee2caffeac7013.
-rw-r--r--ranger/gui/curses_shortcuts.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py
index cf6607b6..43b583a6 100644
--- a/ranger/gui/curses_shortcuts.py
+++ b/ranger/gui/curses_shortcuts.py
@@ -26,19 +26,21 @@ class CursesShortcuts(SettingsAware):
 		try:
 			self.win.addstr(*args)
 		except:
-			try:
-				self.win.addstr(*_fix_surrogates(args))
-			except:
-				pass
+			if len(args) > 1:
+				try:
+					self.win.addstr(*_fix_surrogates(args))
+				except:
+					pass
 
 	def addnstr(self, *args):
 		try:
 			self.win.addnstr(*args)
 		except:
-			try:
-				self.win.addnstr(*_fix_surrogates(args))
-			except:
-				pass
+			if len(args) > 2:
+				try:
+					self.win.addnstr(*_fix_surrogates(args))
+				except:
+					pass
 
 	def addch(self, *args):
 		try: