-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activating liquidprompt clobbers completion options #641
Comments
Referencing this line: I read the Zsh manual on this module: http://zsh.sourceforge.net/Doc/Release/Completion-System.html
So My thought process was why not enable completion. But I didn't realize that running So I see a few solutions:
Any ideas on how to detect the current state of the completion system? Actually, it looks like a function:
So I think this patch should work: - autoload -Uz compinit && compinit && compdef __lp_theme_zsh_complete lp_theme
+ # Enable the autocomplete if the autocomplete system is initialized.
+ __lp_is_function compdef && compdef __lp_theme_zsh_complete lp_theme Would that fix your issue? |
That was fast! Thanks. I tried your patch, and it fixes my issue, yes. I don't know what completion that compdef is enabling, so I can't confirm that it still enables it though. |
It's for the |
I had discovered while working on the completion support for lp_theme() that calling compdef before compinit would error. So I assumed that calling compinit first would be the right call. But actually calling compinit removes all previously set completions, which is not what most users want. Rather than force users to turn on completion, instead detect if zsh has completion enabled (by looking for the compdef function), and if so adding our completion. Fixes liquidprompt#641
When I set a zsh completion option, and then activate liquidprompt, my completion option is gone.
In my case, I have a git shortcut function, and I set the completion to be the same as for git:
Now the completion for "g" doesn't work properly. If I define the completion after the prompt, then it does work:
Shell: zsh 5.8 (x86_64-apple-darwin17.7.0)
Operating system: MacOS 10.13.6
Liquidprompt version: v2.0.0-beta.2
Possible Solution
Why invoke "compinit" when activating the prompt? Leave that out.
The text was updated successfully, but these errors were encountered: