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:
|
class CompletionSpec:
|
||||||
|
|
||||||
type: CompletionType = CompletionType.none
|
type: CompletionType = CompletionType.none
|
||||||
kwds: Sequence[str] = ()
|
kwds: Tuple[str,...] = ()
|
||||||
extensions: Sequence[str] = ()
|
extensions: Tuple[str,...] = ()
|
||||||
mime_patterns: Sequence[str] = ()
|
mime_patterns: Tuple[str,...] = ()
|
||||||
group: str = ''
|
group: str = ''
|
||||||
relative_to: CompletionRelativeTo = CompletionRelativeTo.cwd
|
relative_to: CompletionRelativeTo = CompletionRelativeTo.cwd
|
||||||
|
|
||||||
@ -50,13 +50,13 @@ class CompletionSpec:
|
|||||||
if ck == 'type':
|
if ck == 'type':
|
||||||
self.type = getattr(CompletionType, vv)
|
self.type = getattr(CompletionType, vv)
|
||||||
elif ck == 'kwds':
|
elif ck == 'kwds':
|
||||||
self.kwds = tuple(vv.split(','))
|
self.kwds += tuple(vv.split(','))
|
||||||
elif ck == 'ext':
|
elif ck == 'ext':
|
||||||
self.extensions = tuple(vv.split(','))
|
self.extensions += tuple(vv.split(','))
|
||||||
elif ck == 'group':
|
elif ck == 'group':
|
||||||
self.group = vv
|
self.group = vv
|
||||||
elif ck == 'mime':
|
elif ck == 'mime':
|
||||||
self.mime_patterns = tuple(vv.split(','))
|
self.mime_patterns += tuple(vv.split(','))
|
||||||
elif ck == 'relative':
|
elif ck == 'relative':
|
||||||
if vv == 'conf':
|
if vv == 'conf':
|
||||||
self.relative_to = CompletionRelativeTo.config_dir
|
self.relative_to = CompletionRelativeTo.config_dir
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user