Skip to content

extendedglob pattern with (( breaks syntax highlighting #33

@mr-salty

Description

@mr-salty

I ran into this in my own scripts but I found an example from the zsh docs as some proof I'm not writing something completely weird (see the section on s,e which must be enclosed in parentheses)

if [[ "${path}" = *((#s)|/)test((#e)|/)* ]]; then
  echo "match"
fi

this breaks highlighting for the rest of the file (echo) and (fi) should be a red color:

image

note the *, |, and # do not matter, if [[ "${path}" = ((a)b) ]]is also broken - although if [[ "${path}" = ((a)) ]] is ok (I know those latter two don't make much sense, just to illustrate).

I will try to send a PR, but the syntax file is pretty daunting so I thought I'd see if there was an easy/obvious solution.
I do have the latest version (2020-11-21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions