aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-17 22:09:23 +0700
committerwustho <benawiadha@gmail.com>2020-04-17 22:17:17 +0700
commit9541dc4ffa2d12cc1283fb634fd4b7752e583a2d (patch)
treef6a1759c812f9734c0d29772cd1afc03fb9701c4 /epy.py
parent1a77fdc1f4f6a5f9b5925ed5cb8d8e1a761784a6 (diff)
downloadepy-9541dc4ffa2d12cc1283fb634fd4b7752e583a2d.tar.gz
Added quick shortcut "Yn" if ch_list == ["(Y)es", "(N)o"] in choice_win().
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/epy.py b/epy.py
index e5d438e..fda5517 100755
--- a/epy.py
+++ b/epy.py
@@ -534,12 +534,20 @@ def choice_win(allowdel=False):
index = totlines - 1
elif key_chwin == ord("d") and allowdel:
resp, _ = choice_win()(
- lambda: ("Are you sure?", ["Yes", "No"], 0, {ord("n")})
+ lambda: ("Delete '{}'?".format(
+ ch_list[index]
+ ), ["(Y)es", "(N)o"], 0, {ord("n")})
)()
if resp == 0:
return (0 if index == 0 else index-1), index
chwin.redrawwin()
chwin.refresh()
+ elif key_chwin in {ord(i) for i in ["Y", "y", "N", "n"]}\
+ and ch_list == ["(Y)es", "(N)o"]:
+ if key_chwin in {ord("Y"), ord("y")}:
+ return 0, None
+ else:
+ return 1, None
elif key_chwin in WINKEYS - key:
return key_chwin, None
countstring = ""