Handle 'O' and '?' in taglist subprompt

These 2 inputs do not change the taglist. So we can do without losing context.
In addition, defer the handling of error cases.
This commit is contained in:
Arun Prakash Jana 2018-02-18 23:04:26 +05:30
parent e43c0ea58d
commit 2fa6fb07c7
No known key found for this signature in database
GPG Key ID: A75979F35C080412

17
buku.py
View File

@ -3062,14 +3062,21 @@ def taglist_subprompt(obj, noninteractive=False):
if is_int(nav) and int(nav) > 0 and int(nav) < count:
return 't ' + unique_tags[int(nav) - 1]
elif nav == 't':
new_results = True
elif (nav in ('d', 'w', 'q') or
nav.startswith(('s ', 'S ', 'r ', 't ', 'o ', 'p ', 'g ', 'w ', 'c '))):
return nav
elif nav == 'O':
browse.override_text_browser = not browse.override_text_browser
print('text browser override toggled')
new_results = False
elif nav == '?':
ExtendedArgumentParser.prompt_help(sys.stdout)
new_results = False
elif is_int(nav):
print('No matching index %s' % nav)
new_results = False
elif nav == 't':
new_results = True
elif (nav == 'q' or nav == 'd' or nav == '?' or nav == 'O' or
nav.startswith(('s ', 'S ', 'r ', 't ', 'o ', 'p ', 'g ', 'w ', 'c ')) or nav == 'w'):
return nav
else:
print('Invalid input')
new_results = False