Closed 91khr closed 2 years ago
Bash and POSIX sh use same parenthese syntax, so these should use same setting. But I see the author disabled this plugin for ft=sh. @luochen1990 Is this caused by this syntax? If it is, please use same setting for sh and bash as well.
BTW, POSIX compatible shell like ash and dash (bash and zsh as well) also using same syntax, but csh/tcsh use single parenthese syntax for arithmetic operations and fish use a math
built-in command, so csh/tcsh/fish shouldn't use same setting, normal setting is enough for them.
Well, there's something more than the arithmetic expressions' double quotes. Maybe the dollar sign before the substitutions should be matched as a part of the parentheses? And... Should the backtick command substitution be matched... ?
Inspired by and thus fixes #174
Some languages like shell (and maybe Agda) have a somehow complex syntax:
Handling this is not so easy as it seems to be: outside of the arithmetic expression, only single parentheses can be matched, otherwise we can't match the parentheses for the arithmetic expressions, but inside the arithmetic expression, single parentheses should always be matched as-is since the expression can't be nested. In vim's origin design, this is solved by
contained
etc.; but since Rainbow generates lots of syntax rules to highlight parentheses at different levels, unfortunately vim provides no mechanism to deal with them.This is one possible approach of solving the problem: bundle different parentheses into 'kind's like vim bundle syntax clusters, so that the parentheses can cascade correctly.