| 432 | } |
| 433 | |
| 434 | static 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. |
no test coverage detected