Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!
MIT License
3.41k stars 96 forks source link

[BUG] Syntax highlighting disappears when completion is cancelled #443

Closed musjj closed 2 months ago

musjj commented 6 months ago

Describe the bug

A clear and concise description of what the bug is.

I can make sure:

To Reproduce

  1. Install the fast-syntax-highlighting plugin
  2. Trigger a completion
  3. Press Esc to cancel the completion

Expected behavior

The syntax highlighting does not disappear

Environment:

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

Aloxaf commented 5 months ago

can you make sure compinit has been called before load fzf-tab?

boobiq commented 3 months ago

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

Aloxaf commented 2 months ago

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.