summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorA. Lopes <ajtluser@openmailbox.com>2015-10-15 17:15:42 +0100
committerA. Lopes <ajtluser@openmailbox.com>2015-10-15 17:15:42 +0100
commitc831d7fdd8abe37d6f46332f8e4cf8f272f16660 (patch)
tree244f18f3ddebc710f0d08a4f25984c5547d74c80
parent8a263f02dd3c5b2da4d2ebb0cb0814b9f828cf6c (diff)
downloadranger-c831d7fdd8abe37d6f46332f8e4cf8f272f16660.tar.gz
Fix for issue #332. Broken file shortening.
The filename on the second to last line of the screen is now properly
shortened.
-rw-r--r--ranger/gui/curses_shortcuts.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py
index 187891c6..e7573f17 100644
--- a/ranger/gui/curses_shortcuts.py
+++ b/ranger/gui/curses_shortcuts.py
@@ -25,20 +25,28 @@ class CursesShortcuts(SettingsAware):
     """
 
     def addstr(self, *args):
+        y, x = self.win.getyx()
+
         try:
             self.win.addstr(*args)
         except:
             if len(args) > 1:
+                self.win.move(y, x)
+
                 try:
                     self.win.addstr(*_fix_surrogates(args))
                 except:
                     pass
 
     def addnstr(self, *args):
+        y, x = self.win.getyx()
+
         try:
             self.win.addnstr(*args)
         except:
             if len(args) > 2:
+                self.win.move(y, x)
+
                 try:
                     self.win.addnstr(*_fix_surrogates(args))
                 except: