mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 13:45:26 +02:00
Add keywords completion for --cwd and --config
This commit is contained in:
@@ -612,7 +612,7 @@ are running a program that does not set titles.
|
||||
|
||||
--config -c
|
||||
type=list
|
||||
completion=type:file ext:conf group:"Config files"
|
||||
completion=type:file ext:conf group:"Config files" kwds:none,NONE
|
||||
{config_help}
|
||||
|
||||
|
||||
|
||||
@@ -637,6 +637,10 @@ def complete_file_path(ans: Completions, spec: Dict[str, str], prefix: str, only
|
||||
def complete_path(ans: Completions, opt: OptionDict, prefix: str) -> None:
|
||||
spec = opt['completion']
|
||||
t = spec['type']
|
||||
if 'kwds' in spec:
|
||||
kwds = [x for x in spec['kwds'].split(',') if x.startswith(prefix)]
|
||||
if kwds:
|
||||
ans.add_match_group('Keywords', kwds)
|
||||
if t == 'file':
|
||||
complete_file_path(ans, spec, prefix)
|
||||
elif t == 'directory':
|
||||
|
||||
@@ -73,6 +73,7 @@ opened window.
|
||||
|
||||
|
||||
--cwd
|
||||
completion=type:directory kwds:current,oldest,last_reported
|
||||
The working directory for the newly launched child. Use the special value
|
||||
:code:`current` to use the working directory of the currently active window.
|
||||
The special value :code:`last_reported` uses the last working directory reported
|
||||
|
||||
Reference in New Issue
Block a user