From 681fe7f2f233b40bd3625671152c75380856c02d Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Mon, 13 Apr 2020 23:02:44 +0200 Subject: [PATCH] Don't set word_characters to select_by_word_characters when empty string This allows you to pass in --word-characters "" which will make hints only match \w. --- kittens/hints/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kittens/hints/main.py b/kittens/hints/main.py index fba88370b..fe256cb28 100644 --- a/kittens/hints/main.py +++ b/kittens/hints/main.py @@ -315,7 +315,7 @@ def functions_for(args: HintsCLIOptions) -> Tuple[str, List[PostprocessorFunc]]: pattern = '[0-9a-f]{7,128}' elif args.type == 'word': chars = args.word_characters - if not chars: + if chars is None: chars = kitty_common_opts()['select_by_word_characters'] pattern = r'(?u)[{}\w]{{{},}}'.format(escape(chars), args.minimum_match_length) post_processors.extend((brackets, quotes))