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..cf0e2b437 100644 --- a/kitty/marks.py +++ b/kitty/marks.py @@ -56,7 +56,7 @@ 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()) + grp = match.lastgroup color.value = color_map[grp] yield