diff options
Diffstat (limited to 'src/LexSQL.cxx')
-rw-r--r-- | src/LexSQL.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx index 75a958cb6..19d81ebcb 100644 --- a/src/LexSQL.cxx +++ b/src/LexSQL.cxx @@ -43,7 +43,6 @@ static inline bool IsANumberChar(int ch) { ch == '.' || ch == '-' || ch == '+'); } - static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { @@ -60,7 +59,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, Wo bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0; bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0; - int styleBeforeDCKeyword = SCE_C_DEFAULT; + int styleBeforeDCKeyword = SCE_SQL_DEFAULT; bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); @@ -248,7 +247,7 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle, int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) { - levelCurrent = styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK; + levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; } int levelNext = levelCurrent; char chNext = styler[startPos]; @@ -326,16 +325,14 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle, } } if (atEOL) { - int level = levelCurrent; - if (visibleChars == 0 && foldCompact) { - // Empty line - level |= SC_FOLDLEVELWHITEFLAG; - } - if (visibleChars > 0 && levelNext > levelCurrent) { - level |= SC_FOLDLEVELHEADERFLAG; - } - if (level != styler.LevelAt(lineCurrent)) { - styler.SetLevel(lineCurrent, level); + int levelUse = levelCurrent; + int lev = levelUse | levelNext << 16; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if (levelUse < levelNext) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; |