> Thanks for your email.
> Please find attached the small script bash I tested where the
> variables i, j, limit_t, limit_j are unfortunately not highlighted in
> the standard for-loop, in contrast to the label variable in the
> for-each-like loop.
> On Wed, May 20, 2020 at 4:47 AM Charles Campbell <[hidden email] > <mailto:[hidden email]>> wrote:
> Hakim Benoudjit wrote:
> > Hi,
> > I wasn't sure if this was a bug or not, so I've updated my Vim
> > to 8.2 on Ubuntu 18.04.
> > And, as you can see below, the variables in the standard for-loop
> > aren't highlighted as they are in the following for loop:
> I'm the maintainer of syntax/sh.vim ; would you please send me an
> attachment of the code snippet you're having a problem with?
In the for (( ... )) loop, the items inside are highlighted as shForPP ;
ie. as inside a region. The variables themselves are not individually
identified. The "<=" and other operators are highlighted as shTestOpr
(ie. operators). All is normal.
In the first echo ... the variables are, again, not identified as
variables; instead, they're being shown as
shDo->shDo->shEcho->shDoubleQuote ; ie. regular string highlighting.
In the second outside loop (ie. the one with "label"), label is not
recognized as a variable. Instead, its being recognized as being inside
a for loop (shFor), so its being highlighted correctly for that
situation. Copying the echo "i:..." into the body of the "label" for
loop shows its highlighted the same as in the other place.
Generally, I try not to identify variables because of the potential
problems (is it really an alias? a function? etc); remember, the syntax
highlighter isn't a parser. I do have a shVar; I'll have to see if
including it in the for loops' containment lists causes problems.
So, insofar as the variables are concerned, the highlighting is
That said, there seems to be some unwanted highlighting associated with
the double quotes, and I'll look into that.
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php