zdharma-continuum / fast-syntax-highlighting

Feature-rich syntax highlighting for ZSH
BSD 3-Clause "New" or "Revised" License
1.06k stars 76 forks source link

[bug]: Syntax highlighting during completion #48

Closed musjj closed 1 year ago

musjj commented 1 year ago

Describe the bug

When normally typing things like valid paths or arguments, they will be highlighted. But when using the auto completion system, the highlighting is gone.

Steps to reproduce

  1. Install zsh-users/zsh-completions
  2. Type a valid path or argument, it should get highlighted
  3. Re-type it using auto-completion. This time there won't be any highlighting until you press space.

Expected behavior

Paths and arguments should still be highlighted as you complete it.

Screenshots and recordings

No response

Operating System & Version

linux-gnu | pc | x86_64 | x86_64 | x86_64 unknown

Zsh version

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator

xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response

musjj commented 1 year ago

Looks like this feature requires a redraw hook: https://github.com/zsh-users/zsh-syntax-highlighting/issues/654 Can we port this feature to this plugin?

musjj commented 1 year ago

Never mind, looks like this is caused by the fact that jeffreytse/zsh-vi-mode is lazy-loaded. This adds some surprises to the load order of my plugins, which is the source of issues like this.

The solution is to turn off lazy-loading by doing:

ZVM_INIT_MODE=sourcing