From f2e13eed5cd366a40e60454f569fc2938f8205f7 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 10 Jun 2009 11:06:42 +0000 Subject: Ensure final empty line in a file has its fold level updated to avoid unexpected sticky states. --- src/LexCPP.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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(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; } } -- cgit v1.2.3