| 598 | } |
| 599 | |
| 600 | uint32_t GetLineLengthWithoutColor(const std::string line) { |
| 601 | // Currently, every added color is in the form \x1b...m, so instead of doing a |
| 602 | // lot of string comparisons with spvtools::clr::* strings, we just ignore |
| 603 | // those ranges. |
| 604 | uint32_t length = 0; |
| 605 | for (size_t i = 0; i < line.size(); ++i) { |
| 606 | if (line[i] == '\x1b') { |
| 607 | do { |
| 608 | ++i; |
| 609 | } while (i < line.size() && line[i] != 'm'); |
| 610 | continue; |
| 611 | } |
| 612 | |
| 613 | ++length; |
| 614 | } |
| 615 | |
| 616 | return length; |
| 617 | } |
| 618 | |
| 619 | constexpr int kStandardIndent = 15; |
| 620 | constexpr int kBlockNestIndent = 2; |
no test coverage detected