Skip to content

Highlighter prints things when regex highlighting is triggered for the 1st time after login: #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Leedehai opened this issue Jan 23, 2018 · 3 comments

Comments

@Leedehai
Copy link

Leedehai commented Jan 23, 2018

This is my addition to zsh-syntax-highlighting/highlighters/regexp/regexp-highlighter.zsh imediately after the line typeset -gA ZSH_HIGHLIGHT_REGEXP:

# Highlight 'ls' and 'cd'
ZSH_HIGHLIGHT_REGEXP+=('(^| )(ls|cd)($| )' 'fg=green')

Everytime the regex is triggered for the 1st time after login, the terminal prints things. The 2nd time and beyond, it works fine

Last login: Mon Jan 22 19:28:18 on ttys000
▸ ~ ls
_zsh_highlight_regexp_highlighter_loop:6: array parameter match created globally in function _zsh_highlight_regexp_highlighter_loop
_zsh_highlight_regexp_highlighter_loop:6: array parameter mbegin created globally in function _zsh_highlight_regexp_highlighter_loop
_zsh_highlight_regexp_highlighter_loop:6: array parameter mend created globally in function _zsh_highlight_regexp_highlighter_loop
▸ ~ ls
Applications   Downloads      Movies         Public         pymel.log      vscode
Desktop        GoogleDrive    Music          VirtualBox VMs safe-rm.sh     vscode.zip
Documents      Library        Pictures       anaconda2      settings.json  xgen
▸ ~

This behavior repeats if your logout and login again.

@Leedehai Leedehai changed the title _zsh_highlight_regexp_highlighter_loop prints things _zsh_highlight_regexp_highlighter_loop prints things when regex highlighting is triggered for the first time after login: Jan 23, 2018
@Leedehai Leedehai changed the title _zsh_highlight_regexp_highlighter_loop prints things when regex highlighting is triggered for the first time after login: Highlighter prints things when regex highlighting is triggered for the first time after login: Jan 23, 2018
@Leedehai Leedehai changed the title Highlighter prints things when regex highlighting is triggered for the first time after login: Highlighter prints things when regex highlighting is triggered for the 1st time after login: Jan 23, 2018
phy1729 added a commit to phy1729/zsh-syntax-highlighting that referenced this issue Jan 23, 2018
@phy1729
Copy link
Member

phy1729 commented Jan 23, 2018

Thanks for the bug report with reproducer! Does the latest commit to master fix the issue?

@Leedehai
Copy link
Author

Leedehai commented Aug 8, 2020

Whoops, sorry I must have missed the message at that time! It was definitely not my intention to be rude by not responding. I stumbled across this today when I was googling and was surprised it was me who filed this bug..
Yes, it fixed it. Finally I can remove the comment sign in ~/.zshrc to enable this plugin! zsh-syntax-highlighting was hidden after a comment sign for more than 2 years :)

@danielshahaf
Copy link
Member

Thanks for letting us know it works for you now! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants