diff options
| author | oirfeodent <unknown> | 2016-10-03 15:14:40 +0530 | 
|---|---|---|
| committer | oirfeodent <unknown> | 2016-10-03 15:14:40 +0530 | 
| commit | 27ea5a8c1461bd86dd3b43b679480d8dffc5581b (patch) | |
| tree | fbbcb422b690f923b1db5ab5eea49490b70464e3 | |
| parent | 6744fc12bb558e056024944f48b22f23979e7f63 (diff) | |
| download | scintilla-mirror-27ea5a8c1461bd86dd3b43b679480d8dffc5581b.tar.gz | |
Better handling of complex sub-queries folding.
| -rw-r--r-- | lexers/LexBaan.cxx | 21 | 
1 files changed, 14 insertions, 7 deletions
| diff --git a/lexers/LexBaan.cxx b/lexers/LexBaan.cxx index 9faa81ecc..a4e2d413f 100644 --- a/lexers/LexBaan.cxx +++ b/lexers/LexBaan.cxx @@ -580,6 +580,7 @@ void SCI_METHOD LexerBaan::Fold(Sci_PositionU startPos, Sci_Position length, int  	std::string startTags[6] = { "for", "if", "on", "repeat", "select", "while" };  	std::string endTags[6] = { "endcase", "endfor", "endif", "endselect", "endwhile", "until" }; +	std::string selectCloseTags[5] = { "selectdo", "selecteos", "selectempty", "selecterror", "endselect" };  	LexAccessor styler(pAccess);  	Sci_PositionU endPos = startPos + length; @@ -660,15 +661,21 @@ void SCI_METHOD LexerBaan::Fold(Sci_PositionU startPos, Sci_Position length, int  						foldStart = false;  					}  				} -				else if (strcmp(word, "exists") == 0) { -					// Select following an exists clause is a subquery select, do not fold. -					foldNextSelect = false; +				else if (strcmp(word, "select") == 0) { +					if (foldNextSelect) { +						// Next Selects are sub-clause till reach of selectCloseTags[] array. +						foldNextSelect = false; +						foldStart = true; +					} +					else { +						foldNextSelect = false; +						foldStart = false; +					}  				} -				else if (strcmp(word, "select") == 0 && !foldNextSelect) { -					// in continuation to the exists clause. -					foldStart = false; -					// The next select can be folded, but not this one. +				else if (wordInArray(word, selectCloseTags, 5)) { +					// select clause ends, next select clause can be folded.  					foldNextSelect = true; +					foldStart = true;  				}  				else {  					foldStart = true; | 
