diff --git a/docs/changelog.rst b/docs/changelog.rst index a89da491d..45e62891f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,6 +15,9 @@ To update |kitty|, :doc:`follow the instructions `. - Add an option :opt:`confirm_on_os_window_close` to ask for confirmation when closing an OS window with multiple kitty windows. +- Fix marks using different colors with regexes using only a single color + (:pull:`2663`) + 0.17.4 [2020-05-09] -------------------- diff --git a/kitty/config.py b/kitty/config.py index 53f308eb2..dcbc004bc 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -311,7 +311,7 @@ def parse_marker_spec(ftype: str, parts: Sequence[str]) -> Tuple[str, Union[str, def toggle_marker(func: str, rest: str) -> FuncArgsType: parts = rest.split(maxsplit=1) if len(parts) != 2: - raise ValueError('{} if not a valid marker specification'.format(rest)) + raise ValueError('{} is not a valid marker specification'.format(rest)) ftype, spec = parts parts = spec.split() return func, list(parse_marker_spec(ftype, parts)) diff --git a/kitty/marks.py b/kitty/marks.py index 96b59745b..adcc0d1ca 100644 --- a/kitty/marks.py +++ b/kitty/marks.py @@ -56,8 +56,8 @@ def marker_from_multiple_regex(regexes: Iterable[Tuple[int, str]], flags: int = for match in pat.finditer(text): left.value = match.start() right.value = match.end() - 1 - grp = next(k for k, v in match.groupdict().items()) - color.value = color_map[grp] + grp = match.lastgroup + color.value = color_map[grp] if grp is not None else 0 yield return marker