Report overlay ready in case of no match

This commit is contained in:
pagedown
2022-03-25 22:52:35 +08:00
parent 0c4b20aa4e
commit 16c6545e93
4 changed files with 19 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ from kitty.utils import (
from ..tui.handler import Handler, result_handler
from ..tui.loop import Loop
from ..tui.operations import faint, styled
from ..tui.utils import report_unhandled_error
from ..tui.utils import report_error, report_unhandled_error
@lru_cache()
@@ -503,7 +503,7 @@ def run(args: HintsCLIOptions, text: str, extra_cli_args: Sequence[str] = ()) ->
all_marks = tuple(mark(pattern, post_processors, text, args))
if not all_marks:
none_of = {'url': 'URLs', 'hyperlink': 'hyperlinks'}.get(args.type, 'matches')
input(_('No {} found, press Enter to quit.').format(none_of))
report_error(_('No {} found.').format(none_of))
return None
largest_index = all_marks[-1].index