diff options
| author | troido <troido@hotmail.com> | 2018-04-19 16:34:17 +0200 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2018-04-19 16:34:17 +0200 |
| commit | cffcb10b6ae859032afdf58822ea1e66e960caf9 (patch) | |
| tree | 95b56da1e2395ae5f242b5d49118a7d13ad73f6e /asciifarm/client/display/textinput.py | |
| parent | a391351d4747646cbc9503e7d64918a536356370 (diff) | |
client doesn't crash anymore when typing long lines
Diffstat (limited to 'asciifarm/client/display/textinput.py')
| -rw-r--r-- | asciifarm/client/display/textinput.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/asciifarm/client/display/textinput.py b/asciifarm/client/display/textinput.py index 38d69ed..fb27a08 100644 --- a/asciifarm/client/display/textinput.py +++ b/asciifarm/client/display/textinput.py @@ -20,7 +20,7 @@ class TextInput: win = self.widget.getWin() width, height = win.getSize() win.erase() - win.addLine((0, 0), self.text) + win.addLine((0, 0), self.text[:width]) if self.cursor >= 0 and self.cursor <= len(self.text): - win.setAttr((self.cursor, 0), curses.A_REVERSE) + win.setAttr((min(self.cursor, width-1), 0), curses.A_REVERSE) win.noutrefresh() |
