-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Brackets highlighter keeps highlighted paranthesis after entering ZLE's Vi insert mode #890
Comments
This isn't specific to viins mode; you can get it in vicmd mode if you use a bar cursor there too. AFAICT z-sy-h does instruct the terminal to render both parentheses in standout, but the terminal doesn't do so for the parenthesis at the cursor position. So, set ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket] to a different value? Or do you think a change in z-sy-h is required? Thanks for all the bug reports :-) |
AFAICT z-sy-h does instruct the terminal to render both parentheses in
standout, but the terminal doesn't do so for the parenthesis at the
cursor position. So, set ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]
to a different value? Or do you think a change in z-sy-h is required?
Sorry, that's wrong. The cursor-matchingbracket highlight is specifically for the "other" bracket, the mate of the one at the cursor position.
|
Yes, you are correct, seems like the bar cursor on its own is enough to confuse it.
Well, I would like to achieve the expected behavior.
Thank you for triaging/solving them! |
More or less. The The blue block is because the
The white block is just xterm's default cursor shape and color (possibly modified by my distro). The upshot of all this is that as soon as you change the cursor shape, you'll find that only one bracket of the pair gets highlighted… but that's not because changing the cursor shape stops z-sy-h from highlighting one half of a pair of brackets; it's because that bracket only seemed to be highlighted at first, because the default cursor shape coincides (in your environment) with the default rendering of All that being said, it does seem to be the case that
Yeah. We don't know the user's preference, so we shouldn't guess, but make things configurable.
Exactly. We could invent a way to prevent that style from being added, as you suggest (or a way to remove them after being added and before zle processes them — that's admittedly roundabout, but the
No parenthesis at all? Or just neither the one at the cursor nor the mate of the one under the cursor? E.g., on the command line |
You're welcome, and sorry for the confusion above.
Minimal example: |
Maybe I'm missing the point, but to me it seems that only user-exposed variable that prevents applying of the After reading your explanation for how
Probably one more related thing about this is how
Sorry for my bad description. I would want all highlighting to remain as it was before, only that
Nah, it's unrelated to |
Here's the first one: #891 For the second one, it's related to some default zsh settings that I turned off in my configuration, so it's not reproducible in clean environment. If I ever get too annoyed by it, I'll find exactly which setting is triggering it and open the issue then. It can be reproduced in clean environment just by sourcing this version of my config file and |
If you press
That |
This use-case is certainly (1).
Unfortunately, this isn't really as simple... noglobalrcs
interactive
monitor
norcs
shinstdin
zle However, running it after noaliases
noalwayslastprompt
noappendhistory
noautolist
noautomenu
noautoparamkeys
noautoparamslash
noautoremoveslash
nobadpattern
nobanghist
nobareglobqual
nobeep
nobgnice
nocaseglob
nocasematch
nocheckjobs
nocheckrunningjobs
noclobber
nodebugbeforecmd
noequals
noevallineno
noflowcontrol
nofunctionargzero
noglob
noglobalexport
noglobalrcs
nohashcmds
nohashdirs
nohashlistall
nohistbeep
nohistsavebycopy
nohup
interactive
nolistambiguous
nolistbeep
nolisttypes
nomultibyte
nomultifuncdef
nomultios
nonomatch
nonotify
nopromptcr
nopromptpercent
nopromptsp
norcs
shinstdin
noshortloops
nounset For example, without unsetopt -m "*"
setopt ZLE GLOB
source "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) |
We have diverged a bit. |
Steps to reproduce:
termite -e 'zsh -dfi'
main
andbrackets
highlighterEsc
key and position the cursor on the first opened parenthesis.Both parentheses should be highlighted to note that those are one logical pair of open/closed parenthesis.
a
to enter INSERT mode in between parentheses and start writing some code.Expectation: No parenthesis is highlighted as soon as you enter INSERT mode.
Actual behavior: Opened parenthesis stays highlighted while writing in INSERT mode.
Versions:
The text was updated successfully, but these errors were encountered: