aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-11-02 05:18:27 +0000
committernyamatongwe <unknown>2009-11-02 05:18:27 +0000
commit6e8c3a968b121c2f4ea4b8593738611fb7df68f0 (patch)
tree1b1a02cf939eaeb021dd933ec95d2addf6da0234
parentc563199dde32ce1d04e95c478dbd6a3e352f5d4d (diff)
downloadscintilla-mirror-6e8c3a968b121c2f4ea4b8593738611fb7df68f0.tar.gz
Support for SQL Anywhere allowing "ENDIF" to terminate a fold and an option
for "EXISTS" not to.
-rw-r--r--src/LexSQL.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx
index 01aa7ad0f..7a4335bd2 100644
--- a/src/LexSQL.cxx
+++ b/src/LexSQL.cxx
@@ -231,6 +231,10 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0;
+ // property fold.sql.exists
+ // Enables "EXISTS" to end a fold as is started by "IF" in "DROP TABLE IF EXISTS".
+ bool foldSqlExists = styler.GetPropertyInt("fold.sql.exists", 1) != 0;
+
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
@@ -303,9 +307,13 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
}
} else if (strcmp(s, "begin") == 0) {
levelNext++;
- } else if (strcmp(s, "end") == 0 ||
- // DROP TABLE IF EXISTS or CREATE TABLE IF NOT EXISTS
- strcmp(s, "exists") == 0) {
+ } else if ((strcmp(s, "end") == 0) ||
+// // DROP TABLE IF EXISTS or CREATE TABLE IF NOT EXISTS
+ (foldSqlExists && (strcmp(s, "exists") == 0)) ||
+// // SQL Anywhere permits IF ... ELSE ... ENDIF
+// // will only be active if "endif" appears in the
+// // keyword list.
+ (strcmp(s, "endif") == 0)) {
endFound = true;
levelNext--;
if (levelNext < SC_FOLDLEVELBASE) {