| 1607 | } |
| 1608 | |
| 1609 | static void openBracket(std::vector<uint64_t>& brackets, std::vector<uint64_t>& cursor_brackets, |
| 1610 | uint64_t pos, uint64_t i) { |
| 1611 | // check if the cursor is at this position |
| 1612 | if (pos == i) { |
| 1613 | // cursor is exactly on this position - always highlight this bracket |
| 1614 | if (!cursor_brackets.empty()) { |
| 1615 | cursor_brackets.clear(); |
| 1616 | } |
| 1617 | cursor_brackets.push_back(i); |
| 1618 | } |
| 1619 | if (cursor_brackets.empty() && ((i + 1) == pos || (pos + 1) == i)) { |
| 1620 | // cursor is either BEFORE or AFTER this bracket and we don't have any highlighted bracket |
| 1621 | // yet highlight this bracket |
| 1622 | cursor_brackets.push_back(i); |
| 1623 | } |
| 1624 | brackets.push_back(i); |
| 1625 | } |
| 1626 | |
| 1627 | static void closeBracket(std::vector<uint64_t>& brackets, std::vector<uint64_t>& cursor_brackets, |
| 1628 | uint64_t pos, uint64_t i, std::vector<uint64_t>& errors) { |
no test coverage detected