summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-31 01:29:04 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-31 01:29:04 +0000
commit54266c0c7fd9ff17ffc49fed86ef420837e09af4 (patch)
tree0ff692ea78ac99bffebdcef1b2f2a3131cdc7e5d
parenta3ee784d159dff5bc0190b1df2441fb705dea312 (diff)
downloadpoezio-54266c0c7fd9ff17ffc49fed86ef420837e09af4.tar.gz
poezio-54266c0c7fd9ff17ffc49fed86ef420837e09af4.tar.bz2
poezio-54266c0c7fd9ff17ffc49fed86ef420837e09af4.tar.xz
poezio-54266c0c7fd9ff17ffc49fed86ef420837e09af4.zip
fixed #1124
-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