mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 03:12:37 +03:00
Dont show hidden sub-commands during completion
This commit is contained in:
parent
5d0dabe51c
commit
455d0a6048
@ -92,9 +92,8 @@ def completion(self: TestCompletion, tdir: str):
|
||||
self.assertEqual(cp.returncode, 0, f'kitten __complete__ failed with exit code: {cp.returncode}')
|
||||
return json.loads(cp.stdout)
|
||||
|
||||
add('kitty ', has_words('@', '@ls', '+', '+open'))
|
||||
add('kitty ', has_words('@', '+', '+open'))
|
||||
add('kitty @ l', has_words('ls', 'last-used-layout', 'launch'))
|
||||
add('kitty @l', has_words('@ls', '@last-used-layout', '@launch'))
|
||||
|
||||
def make_file(path, mode=None):
|
||||
with open(os.path.join(tdir, path), mode='x') as f:
|
||||
|
@ -104,7 +104,7 @@ func complete_word(word string, completions *Completions, only_args_allowed bool
|
||||
group.Title = "Sub-commands"
|
||||
}
|
||||
for _, sc := range cg.SubCommands {
|
||||
if strings.HasPrefix(sc.Name, word) {
|
||||
if !sc.Hidden && strings.HasPrefix(sc.Name, word) {
|
||||
t := sc.ShortDescription
|
||||
if t == "" {
|
||||
t = sc.HelpText
|
||||
|
Loading…
Reference in New Issue
Block a user