GithubHelp home page GithubHelp logo

Comments (7)

olets avatar olets commented on July 29, 2024

Thanks for the report!

I don't use zsh-syntax-highlighting or Linux so debugging this might take some back and forth; I also don't know if zsh-syntax-highlighting has changed something.

The setup was originally tested in a Ubuntu VM. 👉 What arch are you on?

Your regexes are different from what's in the README. Yours

  • add double quotes around ${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}} and ${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}
  • replaces \< with <

👉 Was that intentional?

style is appropriately adjusted of course

👉 What is it really?

from zsh-abbr.

mikkksewce avatar mikkksewce commented on July 29, 2024

Hey there. I am on Arch Linux (just updated to zsh 5.9)

The changes weren't really intentional, I just copied what was under the Linux section the wiki

ZSH_HIGHLIGHT_REGEXP+=('^[[:blank:][:space:]]*('"${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}"')$' <styles for regular abbreviations>)
ZSH_HIGHLIGHT_REGEXP+=('\<('"${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}"')$' <styles for global abbreviations>)

What I see in the wiki:
image
Maybe I am not understanding something here?
I will try with the changes you mentioned, so without double quotes and <
Currently it still looks like this:

ZSH_HIGHLIGHT_REGEXP+=('^[[:blank:][:space:]]*('"${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}"')$' fg=blue,bg=white,bold)
ZSH_HIGHLIGHT_REGEXP+=('\<('"${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}"')$' fg=magenta,bg=white,bold)

I was thinking it could have something to do with the highlighting bug that some user reported on the zsh-syntax-highligthing bug tracker, see: zsh-users/zsh-syntax-highlighting#857
Which is supposedly fixed in 5.9

from zsh-abbr.

olets avatar olets commented on July 29, 2024

add double quotes…

My mistake, I was looking at #23 (comment) which doesn't use the '". You did what the README says 👍

replaces \< with <

GitHub fooled me. Your initial \< rendered as < because it isn't in backticks.

--

I don't remember why the double quotes were added after the version from #23. What happens if you drop the "s?

ZSH_HIGHLIGHT_REGEXP+=('^[[:blank:][:space:]]*('${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}')$' <styles for regular abbreviations>)
ZSH_HIGHLIGHT_REGEXP+=('\<('${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}')$' <styles for global abbreviations>)

The difference is

% echo "${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}"
"abbr1" "abbr2" "abbr3"
% echo ${(j:|:)${(k)ABBR_GLOBAL_USER_ABBREVIATIONS}}
"abbr1"|"abbr2"|"abbr3"

where the latter looks like it should work in the regex and the former looks like it shouldn't.

from zsh-abbr.

cycloss avatar cycloss commented on July 29, 2024

I just encountered this problem where highlighting wasn't working on macos. Dropping the the double quotes as suggested above by @olets fixed it for me.

from zsh-abbr.

olets avatar olets commented on July 29, 2024

Thanks for confirming @cycloss

from zsh-abbr.

olets avatar olets commented on July 29, 2024

That change is in the readme now!

from zsh-abbr.

olets avatar olets commented on July 29, 2024

Belatedly acknowledging more contributors in https://github.com/olets/zsh-abbr#community and https://zsh-abbr.olets.dev/community/

Would you like to be added @mikkksewce and @cycloss? If so, I'll have the all-contributors bot open a pull request. Then I'll tag you in it to review for correct info

from zsh-abbr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.