aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJames Ribe <manbeardo@gmail.com>2012-03-29 13:18:06 -0500
committerJames Ribe <manbeardo@gmail.com>2012-03-29 13:18:06 -0500
commit010474ebc716e6483d598568861660ce79716def (patch)
treee5a5d43eea9e444d4788c0810f0edfc344999ec1
parent53c2cb986893475ac5c6559f935f279b34cfe0e2 (diff)
downloadscintilla-mirror-010474ebc716e6483d598568861660ce79716def.tar.gz
Fixed a bug with the bash lexer's handling of singly-quoted strings. SF Bug Tracker ID: 3512208
-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 == '`') {