From 54266c0c7fd9ff17ffc49fed86ef420837e09af4 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Sun, 31 Jan 2010 01:29:04 +0000 Subject: fixed #1124 --- src/window.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3