marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.17k stars 142 forks source link

Work around bug in `zdharma/fast-syntax-highlighting` #549

Closed zhou13 closed 1 year ago

zhou13 commented 1 year ago

Environment

apple darwin22.0 /bin/zsh zsh zsh-5.9-0-g73d3173print -l $_autocomplete__funcfiletrace
/Users/yichaozhou/.zgen/zgen.zsh:368
/Users/yichaozhou/.zgen/zgen.zsh:492
/Users/yichaozhou/.zshrc:20
5cc9da1

Steps to reproduce

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
git clone --depth 1 -- https://github.com/zsh-users/zsh-autosuggestions
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source ~/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
marlonrichert commented 1 year ago

Can you checkout the feature branch and try if the problem is solved there?

zhou13 commented 1 year ago

It seems that the problem is not in the feature branch.

zhou13 commented 1 year ago

However, when using the feature branch, the color from z-shell/F-Sy-H is not applied correctly. But that is probably another problem.

marlonrichert commented 1 year ago

@zhou13 That is definitely a bug in zdharma/fast-syntax-highlighting. It appears that, when there are ZLE hooks in play that are not its own, it forgets to update $region_highlight. zsh-users/zsh-syntax-highlighting doesn't have this problem.