fzf-tab icon indicating copy to clipboard operation
fzf-tab copied to clipboard

[BUG] Syntax highlighting disappears when completion is cancelled

Open musjj opened this issue 1 year ago • 2 comments

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

  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:

  • 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

musjj avatar May 17 '24 15:05 musjj

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

Aloxaf avatar Jun 11 '24 07:06 Aloxaf

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

boobiq avatar Aug 17 '24 13:08 boobiq

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.

Aloxaf avatar Sep 25 '24 11:09 Aloxaf