diff options
| author | nyamatongwe <devnull@localhost> | 2010-04-30 07:09:04 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2010-04-30 07:09:04 +0000 | 
| commit | 38c9ba36dfc8ee99f6f1bcdd9811ec199cb5dad1 (patch) | |
| tree | 0d342fd702f1012edcfd4646d158515b2964f2da /src/LexBash.cxx | |
| parent | e63e7ff6354eb01b1955a5a1d1f2deebedeab330 (diff) | |
| download | scintilla-mirror-38c9ba36dfc8ee99f6f1bcdd9811ec199cb5dad1.tar.gz | |
Fix for bug #2830239 Highlight glitch in Shell file with here doc.s
Diffstat (limited to 'src/LexBash.cxx')
| -rw-r--r-- | src/LexBash.cxx | 35 | 
1 files changed, 10 insertions, 25 deletions
| diff --git a/src/LexBash.cxx b/src/LexBash.cxx index 5801278be..1f97e4829 100644 --- a/src/LexBash.cxx +++ b/src/LexBash.cxx @@ -248,14 +248,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,  				sc.SetState(SCE_SH_DEFAULT);  				break;  			case SCE_SH_COMMENTLINE: -				if (sc.ch == '\\' && (sc.chNext == '\r' || sc.chNext == '\n')) { -					// comment continuation -					sc.Forward(); -					if (sc.ch == '\r' && sc.chNext == '\n') { -						sc.Forward(); -					} -				} else if (sc.atLineEnd) { -					sc.ForwardSetState(SCE_SH_DEFAULT); +				if (sc.atLineEnd && sc.chPrev != '\\') { +					sc.SetState(SCE_SH_DEFAULT);  				}  				break;  			case SCE_SH_HERE_DELIM: @@ -294,23 +288,14 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,  						HereDoc.State = 1;  					}  				} else if (HereDoc.State == 1) { // collect the delimiter -					if (HereDoc.Quoted) { // a quoted here-doc delimiter -						if (sc.ch == HereDoc.Quote) { // closing quote => end of delimiter -							sc.ForwardSetState(SCE_SH_DEFAULT); -						} else { -							if (sc.ch == '\\' && sc.chNext == HereDoc.Quote) { // escaped quote -								sc.Forward(); -							} -							HereDoc.Append(sc.ch); -						} -					} else { // an unquoted here-doc delimiter -						if (setHereDoc2.Contains(sc.ch)) { -							HereDoc.Append(sc.ch); -						} else if (sc.ch == '\\') { -							// skip escape prefix -						} else { -							sc.SetState(SCE_SH_DEFAULT); -						} +					if (setHereDoc2.Contains(sc.ch) || sc.chPrev == '\\') { +						HereDoc.Append(sc.ch); +					} else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) {	// closing quote => end of delimiter +						sc.ForwardSetState(SCE_SH_DEFAULT); +					} else if (sc.ch == '\\') { +						// skip escape prefix +					} else { +						sc.SetState(SCE_SH_DEFAULT);  					}  					if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) {	// force blowup  						sc.SetState(SCE_SH_ERROR); | 
