Scintilla highlights strings in bash arrays inconsistently.
Please see the attached screenshot. All strings should be highlighted orange.
Originally reported for Geany at https://github.com/geany/geany/issues/1308.
Also verified with SciTE 3.7.4 and GTK+ 3.22 on Arch Linux.
I agree, single quotes and double quotes should be detected in a list. I will make a patch within this week.
Without whitespace in between parentheses, the lexer intentionally highlights the segment as part of a path spec. It does not check enough syntax yet to do absolutely precise highlighting.
However, I would be very interested in an actual code sample if you have one, rather than artificial snippets. I haven't actually seen anyone use a command list without whitespace in there, ever..
It seems like a holdover from the perl lexer. Perhaps I left it there for pathspecs.
Having checked the bash docs, taking it out completely should not break anything. In the meantime, people writing actual code should not be impacted by this bug.
PKGBUILD files for Arch Linux are actual code samples. These files are used to create packages which then can be installed with the package manager.
Case example for SciTE:
https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/scite
Last edit: Radioactiveman 2017-05-05
Thank you for the example, it is appreciated. My usual bash contact is with tweaking startup scripts. I have found the array part of bash syntax in the reference manual now.
After reviewing my stuff, it turned out that there was a valid reason to put the globbing code in, it is meant to enable zsh scripts to be highlighted without serious breakage. zsh added some globbing stuff with various kinds of syntax, they used parentheses and the # character which caused breakage in bash. I did my best to shovel the whole lot of it into a single highlighting style with some simple heuristics. Too simple, it turned out...
The next post will be the patch and test samples to be picked up and updated in the Scintilla code base.
Here is an update for bash lexing to fix this issue. Attach are LexBash.cxx and test samples. A few more simple rules were added so that single element arrays is highlighted correctly. zsh globs which do not have the extended # syntax will be now highlighted using normal highlighting, a minor behaviour change that perhaps can be called an improvement. Maybe someday I will actually install zsh and do some proper tests...
Code from hg HEAD, tested on gcc version 5.1.0 (tdm-1) on Win 7 Pro.
Committed as [761971].
Related
Commit: [761971]
I've just compiled Geany with your patch (they bundle Scintilla in the project) and the highlighting now works flawlessly. Thanks again for the fast fix.