From 4f5fc1000dcf4ceb0206d6dd0cb2927fd4a54c77 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Mar 2023 13:42:36 +0530 Subject: [PATCH] Allow multiple specifications of kwds,ext,mime in completion specs --- kitty/cli.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kitty/cli.py b/kitty/cli.py index fb6b27e76..87ba27730 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -36,9 +36,9 @@ class CompletionRelativeTo(Enum): class CompletionSpec: type: CompletionType = CompletionType.none - kwds: Sequence[str] = () - extensions: Sequence[str] = () - mime_patterns: Sequence[str] = () + kwds: Tuple[str,...] = () + extensions: Tuple[str,...] = () + mime_patterns: Tuple[str,...] = () group: str = '' relative_to: CompletionRelativeTo = CompletionRelativeTo.cwd @@ -50,13 +50,13 @@ class CompletionSpec: if ck == 'type': self.type = getattr(CompletionType, vv) elif ck == 'kwds': - self.kwds = tuple(vv.split(',')) + self.kwds += tuple(vv.split(',')) elif ck == 'ext': - self.extensions = tuple(vv.split(',')) + self.extensions += tuple(vv.split(',')) elif ck == 'group': self.group = vv elif ck == 'mime': - self.mime_patterns = tuple(vv.split(',')) + self.mime_patterns += tuple(vv.split(',')) elif ck == 'relative': if vv == 'conf': self.relative_to = CompletionRelativeTo.config_dir