MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / modifyFoldLevels

Method modifyFoldLevels

src/ScintillaNext.cpp:215–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void ScintillaNext::modifyFoldLevels(int level, int action)
216{
217 const int totalLines = lineCount();
218
219 int line = 0;
220 while (line < totalLines) {
221 int foldFlags = foldLevel(line); // Even though its called fold level it contains several other flags
222 bool isHeader = foldFlags & SC_FOLDLEVELHEADERFLAG;
223 int actualLevel = (foldFlags & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
224
225 if (isHeader && actualLevel == level) {
226 foldLine(line, action);
227 line = lastChild(line, -1) + 1;
228 }
229 else {
230 ++line;
231 }
232 }
233}
234
235void ScintillaNext::foldAllLevels(int level)
236{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected