From db430aa8f2f6532aa21397ed7254250f2c2a3fea Mon Sep 17 00:00:00 2001 From: xolatile Date: Sat, 2 Mar 2024 07:53:02 -0500 Subject: [PATCH] Reworked shell script highlighting a bit... --- xighlight.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/xighlight.c b/xighlight.c index c02feb1..983b9af 100644 --- a/xighlight.c +++ b/xighlight.c @@ -298,16 +298,17 @@ static void highlight_shell (void) { 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_normal); - syntax_define (false, false, "${", ")", '\\', colour_yellow, effect_italic); - syntax_define (false, false, "$(", "}", '\\', colour_cyan, effect_italic); - syntax_define (false, false, "$((", "))", '\\', colour_blue, effect_italic); + syntax_define (false, true, "$#", " ", '\0', colour_pink, effect_italic); + syntax_define (false, false, "$((", "))", '\0', 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, "||", separators, '\0', colour_cyan, effect_bold); - syntax_define (false, true, ";;", separators, '\0', colour_cyan, effect_bold); - syntax_define (false, true, "<<", separators, '\0', colour_cyan, effect_bold); - syntax_define (false, true, ">>", separators, '\0', colour_cyan, effect_bold); - syntax_define (false, true, "<>", separators, '\0', colour_cyan, effect_bold); + syntax_define (false, true, "&&", " ", '\0', colour_yellow, effect_italic); + syntax_define (false, true, "||", " ", '\0', colour_yellow, effect_italic); + syntax_define (false, true, ";;", " ", '\0', colour_yellow, effect_italic); + syntax_define (false, true, "<<", " ", '\0', colour_yellow, effect_italic); + syntax_define (false, true, ">>", " ", '\0', colour_yellow, effect_italic); + syntax_define (false, true, "<>", " ", '\0', colour_yellow, effect_italic); for (word = 0; word != (int) (sizeof (keywords) / sizeof (keywords [0])); ++word) { syntax_define (false, true, keywords [word], separators, '\0', colour_yellow, effect_bold);