aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-06-10 11:06:42 +0000
committernyamatongwe <devnull@localhost>2009-06-10 11:06:42 +0000
commitf2e13eed5cd366a40e60454f569fc2938f8205f7 (patch)
treee631fbb31456d5ef25d204cf0ee2fff0f4fca0cb
parent55b811f12b1c87b24e33355caca394138f7caaae (diff)
downloadscintilla-mirror-f2e13eed5cd366a40e60454f569fc2938f8205f7.tar.gz
Ensure final empty line in a file has its fold level updated to avoid unexpected
sticky states.
-rw-r--r--src/LexCPP.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index 9a8d49bb6..9577afbda 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -474,6 +474,10 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle,
lineCurrent++;
levelCurrent = levelNext;
levelMinCurrent = levelCurrent;
+ if (atEOL && (i == static_cast<unsigned int>(styler.Length()-1))) {
+ // There is an empty line at end of file so give it same level and empty
+ styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
+ }
visibleChars = 0;
}
}