-
Notifications
You must be signed in to change notification settings - Fork 0
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
Doesn't work alongside zsh-syntax-highlight? #1
Comments
It's arguably more of a bug in zsh-syntax-highlight because that tramples on any highlighting set by any other code while vi-exchange is careful to remove only it's own entry. I don't use zsh-syntax-highlight myself but I'll e-mail the maintainer of it to see if he has any suggestions on how to make it work. Ideally, I'd like it if zsh could make it easier to manage highlighting across multiple plugins. In the mailing list post you cite, I used those two plugins as an example because one was common and well-known and the other was my own. So don't infer too much extra meaning from that, though I am open to resolving this. |
Got it. Is there any chance it can be made to work regardless of highlighting? I know it wouldn't be as user-friendly, but at least it'd work, and I personally can remember the first region I highlighted. It seems like maybe the way it works right now is that it identifies the regions by looking for the part that's highlighted? Maybe if the beginning/end positions are saved it wouldn't be dependent on the highlighting working, so highlighting would simply be sugar on top? |
If you just change region_highlight to some other non-special variable as a temporary hack then I guess it would work without highlighting. |
Would you kindly be open to making this possible through some opt-in environment variable or something, rather than having to fork this and then losing out on the changes you make in the future? I would really appreciate it! |
z-sy-h maintainer here. I've posted a patch for this issue. Unfortunately, a change to zsh itself was required as well (meaning zsh must be recompiled). |
Thanks @danielshahaf |
The zsh patch has been merged. Further updates shall be posted to zsh-users/zsh-syntax-highlighting#418. |
Amazing work, thanks to everyone who made this happen. |
This seems to still be broken (disabling zsh-syntax-highlighting makes it work again). I'm using the fresh build of zsh-syntax-highlighting (master branch). Any ideas anyone? |
@kiprasmel Judging by the last few comments, the fix requires zsh from git master as well, at least until 5.8.0.3 or newer is released. @okapia correct me if I'm wrong. |
okay I tried it (since I use arch btw I had to it works now! tho takes a while like 1 sec or smthn, but might be related to my other configurations: https://github.com/kiprasmel/voidrice/blob/e06b82f515b35422c8230728f324786fbd9b0ad6/.zshrc |
I noticed that zsh-syntax-highlight seems to interfere with this plugin. First I had to add
defer:3
to viexchange with zplug to make it load after zsh-syntax-highlight (which I have asdefer:2
), so that the selection highlight would show up. Second though I noticed that after making the first selection, any movement of the cursor causes that selection to become unhighlighted and it's seemingly forgotten, since making any other exchange selection doesn't actually perform the exchange, instead it seems to wait for the second selection.If I do another exchange operation immediately after making a selection then it does work, for example
cxE
followed bycxB
.I suspect perhaps any motion of the cursor causes zsh-syntax-highlight to redraw/refresh the buffer, which causes the first selection highlight to be lost?
I did notice this mailing list post which shows sample code showing use of viexchange alongside zsh-syntax-highlight, so perhaps you are open to resolving this.
The text was updated successfully, but these errors were encountered: