From 0da566b49f09ce055ead0b6870adc03a7ee4ead0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 25 Mar 2020 10:03:25 +0530 Subject: [PATCH] Hints kitten: Adjust the default regex used to detect line numbers to handle line+column numbers See #2268 --- docs/changelog.rst | 3 +++ kittens/hints/main.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4f4c835c5..3b6424b4a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,6 +10,9 @@ To update |kitty|, :doc:`follow the instructions `. - Fix a regression in 0.17 that broke drawing of borders with non-minimal borders (:iss:`2474`) +- Hints kitten: Adjust the default regex used to detect line numbers to handle + line+column numbers (:iss:`2268`) + 0.17.1 [2020-03-24] -------------------- diff --git a/kittens/hints/main.py b/kittens/hints/main.py index 7f01d7aeb..d4d36e6b8 100644 --- a/kittens/hints/main.py +++ b/kittens/hints/main.py @@ -349,7 +349,7 @@ def parse_input(text: str) -> str: def linenum_marks(text: str, args: HintsCLIOptions, Mark: Type[Mark], extra_cli_args: Sequence[str], *a: Any) -> Generator[Mark, None, None]: regex = args.regex if regex == DEFAULT_REGEX: - regex = r'(?P(?:\S*/\S+)|(?:\S+[.][a-zA-Z0-9]{2,7})):(?P\d+)' + regex = r'(?P(?:\S*/\S+?)|(?:\S+[.][a-zA-Z0-9]{2,7})):(?P\d+)' yield from mark(regex, [brackets, quotes], text, args)