summaryrefslogtreecommitdiff
path: root/src/window.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.py')
-rw-r--r--src/window.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/window.py b/src/window.py
index 87f629e4..27ba0ff4 100644
--- a/src/window.py
+++ b/src/window.py
@@ -197,8 +197,11 @@ class Input(Win):
self.win.clear()
if self.histo_pos >= 0:
self.histo_pos -= 1
- self.win.addstr(self.history[self.histo_pos+1].encode('utf-8'))
self.text = self.history[self.histo_pos+1]
+ if len(self.text) >= self.width-1:
+ self.win.addstr(self.history[self.histo_pos+1][:self.width-1].encode('utf-8'))
+ else:
+ self.win.addstr(self.history[self.histo_pos+1].encode('utf-8'))
self.pos = len(self.text)
self.refresh()
@@ -208,8 +211,11 @@ class Input(Win):
self.win.clear()
if self.histo_pos < len(self.history)-1:
self.histo_pos += 1
- self.win.addstr(self.history[self.histo_pos].encode('utf-8'))
self.text = self.history[self.histo_pos]
+ if len(self.text) >= self.width-1:
+ self.win.addstr(self.history[self.histo_pos][:self.width-1].encode('utf-8'))
+ else:
+ self.win.addstr(self.history[self.histo_pos].encode('utf-8'))
self.pos = len(self.text)
else:
self.histo_pos = len(self.history)-1