diff options
author | nyamatongwe <unknown> | 2009-06-10 11:06:42 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2009-06-10 11:06:42 +0000 |
commit | efd26ab9a59febf451f0ca0f66b0836246765f84 (patch) | |
tree | e631fbb31456d5ef25d204cf0ee2fff0f4fca0cb /src | |
parent | 6da8de0a7cb1bea87e50116a30d2eed7a32216f1 (diff) | |
download | scintilla-mirror-efd26ab9a59febf451f0ca0f66b0836246765f84.tar.gz |
Ensure final empty line in a file has its fold level updated to avoid unexpected
sticky states.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexCPP.cxx | 4 |
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; } } |