Allow multiple specifications of kwds,ext,mime in completion specs
This commit is contained in:
parent
41ea5f0c63
commit
4f5fc1000d
12
kitty/cli.py
12
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user