I’d want my syntax highlighting to detect unclosed brackets, by tinting as invalid_illegal the ending spaces of a file if their are in a context other than main.
For this, I was thinking of adding a match rule like this
- match: \s*\Z
scope: invalid.illegal
The problem is that \Z seems to be the same semantics as $ in sregex. So is there any other way to test with a regex in the syntax lexer wether we met the end of file as opposed to the end of line? Event in a line-based engine, one would thing that a special patter would be exposed to test if the line is the last line in the buffer without us having to resorts to linting the file.