diff options
author | nyamatongwe <devnull@localhost> | 2003-04-21 10:28:26 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2003-04-21 10:28:26 +0000 |
commit | da722dd5c385ed15c09e19bd4b52c00dfb5eaa1a (patch) | |
tree | fabd2641345ba9de8d0307ad98b34bf863b14740 /src/Editor.cxx | |
parent | 279f5f7cad53f0f8dabf7dcdd5781a46b0d70b25 (diff) | |
download | scintilla-mirror-da722dd5c385ed15c09e19bd4b52c00dfb5eaa1a.tar.gz |
New folding scheme that allows "} else {" to be a fold header.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 2eba8a471..0cb693ba6 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1576,8 +1576,15 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { number[0] = '\0'; if (firstSubLine) sprintf(number, "%d", lineDoc + 1); - if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) - sprintf(number, "%X", pdoc->GetLevel(lineDoc)); + if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { + int lev = pdoc->GetLevel(lineDoc); + sprintf(number, "%c%c %03X %03X", + (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', + (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', + lev & SC_FOLDLEVELNUMBERMASK, + lev >> 16 + ); + } PRectangle rcNumber = rcMarker; // Right justify int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, strlen(number)); @@ -2476,7 +2483,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { } else { int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; - int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK); + int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK) & ~(0xFFF0000); int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars); // Draw line above fold if ((FoldLevelPrev < FoldLevelCurr) |