-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
medium sized line (530 chars) is not highlighted #2647
Comments
see #2603 (comment) |
Thanks! I will try to use "sublime-syntax". |
BTW I use the same regex for VSCode and Atom editors (they also have Oniguruma engine) and this issue doesn't reproduce in any of them. Maybe they have different timeout? |
ST uses a custom non-backtracking regex engine called sregex that is significantly more performant (mostly due to the fact it's non-backtracking) for sublime-syntax, as long as the regex patterns don't rely on backtracking inside them (which they usually don't). |
ST uses its custom regex engine for
even if your regex pattern is compatible with sregex, using a simpler pattern and multiple contexts may perform better / not exhibit this problem. i.e. define a variable to match one csv field, and reuse that in multiple contexts which will decide which scope to apply to the match for your desired rainbow highlighting. In each context, set to the next one when the field separator is matched. and in the |
I've made an experimental sublime-syntax grammar ( gist - double quotes are ignored ) that highlights a long csv line where an equivalent tmLanguage grammar fails. Also it works ~2 times faster on large csv files. |
👍 Also, as a general suggestion, multiple scopes like |
The original report was most likely related to backtracking within Oniguruma. The current dev builds have a newer version of Oniguruma, and it will print to the console when it gives up due to having tried too many times to find a match. Between this and the fact that a much better syntax approach has been devised, I'd say this issue is "resolved". @mechatroner If you want more help with syntax definitions, I'd recommend posting in the forum, or on the Discord server (see the forum for the server URL). |
Description
Syntax highlighting breaks at the second line (530) chars in the following file:
Language name: "CSV (Rainbow)" - rainbow_csv extension
Steps to reproduce
Before adding last "f" character
After adding last "f" character
Expected behavior
the second line is still highlighted
Actual behavior
the second line is not highlighted
Environment
I know there is a problem with 16384 character lines ( #513 ) but my line is much shorter.
The text was updated successfully, but these errors were encountered: