Skip to content
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

[Bug] Arithmetic operation using (( xxx )) is rendered wrongly in bash/zsh #174

Open
CoelacanthusHex opened this issue Nov 29, 2021 · 1 comment
Labels

Comments

@CoelacanthusHex
Copy link

Describe the bug

Arithmetic operation using (( xxx )) is rendered wrongly, it has two color, but it should have only one color in syntax.

To Reproduce

Steps to reproduce the behavior, Please provide a minimal piece of code to produce this issue, along with it's filename and it's filetype detected by vim (via :set ft?), a piece of text is better than a picture here. For example:

File: bug.zsh, filetype=zsh

(( 12344 == 16777216 ))

Steps:

  1. Open file via vim bug.zsh
  2. See the color of (( and ))

Expected behavior

two brackets is rendered as same color as syntax

Screenshots

图片

Additional context

If the technology does not work, please turn off this plugin for bash and zsh like sh.
As here: 108eb2b#diff-3ec0c4a499b949d280a477e6ea520fc842dc3db99a83c9281573ed59af0d4ff5R43

@91khr
Copy link
Contributor

91khr commented Dec 4, 2021

Following config fixes this, and similar issue on other shells can be fixed similarly:

let g:rainbow_conf = #{
            \     separately: #{
            \         zsh: #{
            \             parentheses: ['start=/((/ end=/))/', 'start=/\v\(\ze($|[^(])/ end=/)/',
            \                 'start=/(/ end=/)/ contained containedin=zshMathSubst',
            \                 'start=/\V[[/ end=/]]/', 'start=/\v\[\ze($|[^[])/ end=/]/',
            \                 'start=/{/ end=/}/'],
            \         },
            \     },
            \ }

There is some work on adding a 'cluster' mechanic like vim's to add more flexibility for more complex occasions... But is it worth the cost... ? > <
(A draft with feature added but without document updated is at https://github.com/91khr/rainbow

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

Successfully merging a pull request may close this issue.

3 participants