aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lexers/LexBash.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/lexers/LexBash.cxx b/lexers/LexBash.cxx
index 165e10498..8cd6cc570 100644
--- a/lexers/LexBash.cxx
+++ b/lexers/LexBash.cxx
@@ -425,7 +425,6 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
}
break;
case SCE_SH_STRING: // delimited styles
- case SCE_SH_CHARACTER:
case SCE_SH_BACKTICKS:
case SCE_SH_PARAM:
if (sc.ch == '\\' && Quote.Up != '\\') {
@@ -439,6 +438,14 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
Quote.Count++;
}
break;
+ case SCE_SH_CHARACTER: // singly-quoted strings
+ if (sc.ch == Quote.Down) {
+ Quote.Count--;
+ if (Quote.Count == 0) {
+ sc.ForwardSetState(SCE_SH_DEFAULT);
+ }
+ }
+ break;
}
// Must check end of HereDoc state 1 before default state is handled
@@ -507,7 +514,7 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
if (sc.ch == '{') {
sc.ChangeState(SCE_SH_PARAM);
} else if (sc.ch == '\'') {
- sc.ChangeState(SCE_SH_CHARACTER);
+ sc.ChangeState(SCE_SH_STRING);
} else if (sc.ch == '"') {
sc.ChangeState(SCE_SH_STRING);
} else if (sc.ch == '(' || sc.ch == '`') {