From aacb4db2dcc980424bbf3ada8da4bf0e89e25787 Mon Sep 17 00:00:00 2001 From: pagedown Date: Fri, 27 Jan 2023 23:31:06 +0800 Subject: [PATCH] Remote control: Improve create-marker error messages No more missing color errors when text/regex are missing. Use `mark group` in error messages instead of `color`. --- kitty/options/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/options/utils.py b/kitty/options/utils.py index 4df2f1dff..50adaf0cc 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -329,13 +329,13 @@ def parse_marker_spec(ftype: str, parts: Sequence[str]) -> Tuple[str, Union[str, if ftype.startswith('i'): flags |= re.IGNORECASE if not parts or len(parts) % 2 != 0: - raise ValueError('No color specified in marker: {}'.format(' '.join(parts))) + raise ValueError('Mark group number and text/regex are not specified in pairs: {}'.format(' '.join(parts))) ans = [] for i in range(0, len(parts), 2): try: color = max(1, min(int(parts[i]), 3)) except Exception: - raise ValueError(f'color {parts[i]} in marker specification is not an integer') + raise ValueError(f'Mark group in marker specification is not an integer: {parts[i]}') sspec = parts[i + 1] if 'regex' not in ftype: sspec = re.escape(sspec)