From 27348b453d965fd16a0b61a03321a54a4ed52b45 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 23 Jul 2001 12:53:05 +0000 Subject: Patch from Xavier to add fold.compact feature to the C++ lexer. Defaults to on. --- src/LexCPP.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index b1824615c..512581807 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -331,6 +331,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment"); + bool foldCompact = styler.GetPropertyInt("fold.compact", 1); unsigned int lengthDoc = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); @@ -364,7 +365,7 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis } if (atEOL) { int lev = levelPrev; - if (visibleChars == 0) + if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; -- cgit v1.2.3