aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-17 17:31:26 +0700
committerwustho <benawiadha@gmail.com>2020-04-17 17:31:26 +0700
commit3dd383d6f929dc7e5b44d43e61b58774f843829d (patch)
treeffd204e806ddb12fbf16bffa45a12bc78c78e24d /epy.py
parent390c7e4675a48d0c6835d024dd6391a3640f801b (diff)
downloadepy-3dd383d6f929dc7e5b44d43e61b58774f843829d.tar.gz
Added maxlen=25 to input_prompt().
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index 34a07e4..b50cb7d 100755
--- a/epy.py
+++ b/epy.py
@@ -657,7 +657,7 @@ def help():
return "Help", src, K["Help"]
-def input_prompt(prompt):
+def input_prompt(prompt, maxlen=25):
rows, cols = SCREEN.getmaxyx()
stat = curses.newwin(1, cols, rows-1, 0)
if COLORSUPPORT:
@@ -695,7 +695,7 @@ def input_prompt(prompt):
curses.echo(0)
curses.curs_set(0)
return curses.KEY_RESIZE
- else:
+ elif len(init_text) <= maxlen:
init_text += chr(ipt)
stat.clear()