Reworked shell script highlighting a bit...

This commit is contained in:
Ognjen Milan Robovic 2024-03-02 07:53:02 -05:00
parent e7c2b97ec4
commit db430aa8f2

View File

@ -298,16 +298,17 @@ static void highlight_shell (void) {
syntax_define (false, false, "#", "\n", '\0', colour_grey, effect_bold); syntax_define (false, false, "#", "\n", '\0', colour_grey, effect_bold);
syntax_define (false, false, "'", "'", '\\', colour_pink, effect_bold); syntax_define (false, false, "'", "'", '\\', colour_pink, effect_bold);
syntax_define (false, false, "\"", "\"", '\\', colour_pink, effect_normal); syntax_define (false, false, "\"", "\"", '\\', colour_pink, effect_normal);
syntax_define (false, false, "${", ")", '\\', colour_yellow, effect_italic); syntax_define (false, true, "$#", " ", '\0', colour_pink, effect_italic);
syntax_define (false, false, "$(", "}", '\\', colour_cyan, effect_italic); syntax_define (false, false, "$((", "))", '\0', colour_blue, effect_italic);
syntax_define (false, false, "$((", "))", '\\', colour_blue, effect_italic); syntax_define (false, false, "${", "}", '\0', colour_yellow, effect_italic);
syntax_define (false, false, "$(", ")", '\0', colour_cyan, effect_italic);
syntax_define (false, true, "&&", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, "&&", " ", '\0', colour_yellow, effect_italic);
syntax_define (false, true, "||", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, "||", " ", '\0', colour_yellow, effect_italic);
syntax_define (false, true, ";;", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, ";;", " ", '\0', colour_yellow, effect_italic);
syntax_define (false, true, "<<", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, "<<", " ", '\0', colour_yellow, effect_italic);
syntax_define (false, true, ">>", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, ">>", " ", '\0', colour_yellow, effect_italic);
syntax_define (false, true, "<>", separators, '\0', colour_cyan, effect_bold); syntax_define (false, true, "<>", " ", '\0', colour_yellow, effect_italic);
for (word = 0; word != (int) (sizeof (keywords) / sizeof (keywords [0])); ++word) { for (word = 0; word != (int) (sizeof (keywords) / sizeof (keywords [0])); ++word) {
syntax_define (false, true, keywords [word], separators, '\0', colour_yellow, effect_bold); syntax_define (false, true, keywords [word], separators, '\0', colour_yellow, effect_bold);