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]: `setopt INTERACTIVE_COMMENTS` is not taken into account after setup #67

Open mgkurtz opened 1 month ago

mgkurtz commented 1 month ago

Describe the bug

F-Sy-H correctly highlights comments when INTERACTIVE_COMMENTS is set in zshrc and highlights them as ordinary (usually unknown) tokens otherwise. But, when setting INTERACTIVE_COMMENTS interactively, F-Sy-H keeps the old and now wrong highlighting setting.

I fount this, when I issued setopt INTERACTIVE_COMMENTS to fix fast-theme --test /my/own/theme output.

Steps to reproduce

Install fast-syntax-highlighting, and either have setopt interactive_comments in your ~/.zshrc or keep the default of setopt no_interactive_comments. Then change that setting and type a comment.

Expected behavior

Setting the INTERACTIVE_COMMENTS option should also reset highlighting of comments.

Screenshots and recordings

Examples of unchanged highlighting although the meaning of # gets changed

bug2comment With the default of NO_INTERACTIVE_COMMENTS in effect at startup.

comment2bug With INTERACTIVE_COMMENTS set at startup.

Buggy output of fast-theme --test when NO_INTERACTIVE_COMMENTS is set

fast-theme --test

Operating System & Version

linux-gnu | debian | x86_64 | x86_64 | x86_64 unknown

Zsh version

zsh 5.9 (x86_64-debian-linux-gnu)

Terminal emulator

tmux-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response