Compare commits

...

4 Commits

Author SHA1 Message Date
Sumathi Dhanasekaran a8b55358b5
Merge 3dc13483c1 into 173a14c436 2025-09-23 00:24:09 -04:00
Shohei YOSHIDA 173a14c436
Merge pull request #1154 from SuCicada/master
Fix [virtualbox][vboxmanage controlvm] subcommand completion order an…
2025-09-22 16:36:36 +09:00
SuCicada 1ffeeec3b6 Fix [virtualbox][vboxmanage controlvm] subcommand completion order and regex are incorrect 2025-09-22 14:59:42 +09:00
Sumathi Dhanasekaran 3dc13483c1
Update README.md - Zsh rebuilding the completion cache twice
Zsh rebuilding the completion cache twice
2025-03-13 13:28:59 +00:00
2 changed files with 11 additions and 3 deletions

View File

@ -83,6 +83,14 @@ rm -f ~/.zcompdump; compinit
---
Second Solution:
zsh-completions as a plugin, they suggest manually adding its source directory to fpath before sourcing oh-my-zsh.sh.
This ensures Zsh loads the completion files only once, improving performance.
Recommended Fix:
Instead of the existing method, they propose adding this line:
fpath=($ZSH/custom/plugins/zsh-completions/src $fpath)
### Contributing
Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).

View File

@ -345,10 +345,10 @@ _vboxmanage() {
':machine:_vboxmachines'
;;
(controlvm)
local -a subcommands=(${(@f)"$(vboxmanage $words[1] | perl -wln -e 'm{^\s+([a-z][a-z-]+)} and print $1')"})
local -a subcommands=(${(@f)"$(vboxmanage $words[1] | perl -wln -e 'm{VBoxManage controlvm.*?\s+([a-z][a-z-]+)(?:\s|$)} and print $1')"})
_arguments \
'1:commands:'"($subcommands)" \
':machine:_vboxmachines'
'1:machine:_vboxmachines' \
'2:commands:'"($subcommands)"
;;
esac
;;