MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / UpdateKeywordFoldLevel

Function UpdateKeywordFoldLevel

scintilla/lexers/LexOScript.cxx:434–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

FoldOScriptDocFunction · 0.85

Calls 1

GetRangeLoweredFunction · 0.70

Tested by

no test coverage detected