MCPcopy Create free account
hub / github.com/cxasm/notepad-- / UpdateKeywordFoldLevel

Function UpdateKeywordFoldLevel

src/qscint/scintilla/lexers/LexOScript.cpp:432–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static void UpdateKeywordFoldLevel(int &levelCurrent, Sci_PositionU lastStart,
433 Sci_PositionU currentPos, Accessor &styler) {
434 char s[9];
435 GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s));
436
437 if (strcmp(s, "if") == 0 || strcmp(s, "for") == 0 ||
438 strcmp(s, "switch") == 0 || strcmp(s, "function") == 0 ||
439 strcmp(s, "while") == 0 || strcmp(s, "repeat") == 0) {
440 levelCurrent++;
441 } else if (strcmp(s, "end") == 0 || strcmp(s, "until") == 0) {
442 levelCurrent--;
443 if (levelCurrent < SC_FOLDLEVELBASE) {
444 levelCurrent = SC_FOLDLEVELBASE;
445 }
446 }
447}
448
449// ------------------------------
450// Function folding OScript code.

Callers 1

FoldOScriptDocFunction · 0.85

Calls 1

GetRangeLoweredFunction · 0.70

Tested by

no test coverage detected