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