mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-22 12:07:15 +03:00
Highlight the default choice in yellow
This commit is contained in:
parent
1bbab217d0
commit
9419125387
@ -150,8 +150,8 @@ def __init__(self, cli_opts: AskCLIOptions) -> None:
|
||||
else:
|
||||
allowed = []
|
||||
for choice in cli_opts.choices:
|
||||
color = 'green'
|
||||
letter, text = choice.split(':', maxsplit=1)
|
||||
color = ''
|
||||
if ';' in letter:
|
||||
letter, color = letter.split(';', maxsplit=1)
|
||||
letter = letter.lower()
|
||||
@ -215,7 +215,8 @@ def commit_line(end: str = '\r\n') -> None:
|
||||
|
||||
for letter, choice in self.choices.items():
|
||||
text = choice.text[:choice.idx]
|
||||
text += styled(choice.text[choice.idx], fg=choice.color)
|
||||
color = choice.color or ('yellow' if letter == self.response else 'green')
|
||||
text += styled(choice.text[choice.idx], fg=color)
|
||||
text += choice.text[choice.idx + 1:]
|
||||
text += ' '
|
||||
sz = wcswidth(text)
|
||||
|
Loading…
Reference in New Issue
Block a user