[BUG] Syntax highlighting disappears when completion is cancelled
Describe the bug
A clear and concise description of what the bug is.
I can make sure:
- [x] I am using the latest version of fzf-tab
- [x] this is the minimal zshrc which can reproduce this bug
- [x] fzf-tab is loaded after
compinit - [x] fzf-tab is loaded after plugins which will wrap Tab, like junegunn/fzf/completion.zsh
- [x] fzf-tab is loaded before zsh-autosuggestions, zsh-syntax-highlighting and fast-syntax-highlighting.
To Reproduce
- Install the
fast-syntax-highlightingplugin - Trigger a completion
- Press Esc to cancel the completion
Expected behavior
The syntax highlighting does not disappear
Environment:
- OS: NixOS
- zsh version: 5.9
Minimal zshrc
path+="$HOME/.zsh/plugins/fzf-tab"
fpath+="$HOME/.zsh/plugins/fzf-tab"
path+="$HOME/.zsh/plugins/fast-syntax-highlighting"
fpath+="$HOME/.zsh/plugins/fast-syntax-highlighting"
if [[ -f "$HOME/.zsh/plugins/fzf-tab/fzf-tab.plugin.zsh" ]]; then
source "$HOME/.zsh/plugins/fzf-tab/fzf-tab.plugin.zsh"
fi
if [[ -f "$HOME/.zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" ]]; then
source "$HOME/.zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
fi
can you make sure compinit has been called before load fzf-tab?
I noticed same thing happening, I minimised .zshrc and was able to replicate it with it as well, on video I pressed ESC on 3rd completion.
This is the .zshrc I used:
autoload -Uz compinit
compinit -i
source ~/.config/zsh/fzf-tab/fzf-tab.plugin.zsh
source ~/.config/zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
https://github.com/user-attachments/assets/0480b272-fab4-49fc-80d2-99c7299cf23d
I've tested this, and any completion failure causes the syntax highlighting to disappear, even without using fzf-tab.
It's a bug of fast-syntax-highlighting. zsh-syntax-highlighting works well.
I will look into it someday.