Gets the next valid character index in `lines`, if the current location is not valid. Handles empty lines.
(lineno, col)
| 853 | return _byte_offset_to_character_offset(lines[lineno], offset) |
| 854 | |
| 855 | def next_valid_char(lineno, col): |
| 856 | """Gets the next valid character index in `lines`, if |
| 857 | the current location is not valid. Handles empty lines. |
| 858 | """ |
| 859 | while lineno < len(lines) and col >= len(lines[lineno]): |
| 860 | col = 0 |
| 861 | lineno += 1 |
| 862 | assert lineno < len(lines) and col < len(lines[lineno]) |
| 863 | return lineno, col |
| 864 | |
| 865 | def increment(lineno, col): |
| 866 | """Get the next valid character index in `lines`.""" |
no test coverage detected