How do I disable the red bar that highlights an unclosed quote? I want all other syntax highlighting to remain the same.
(Python - Syntax Specific)
Disable unclosed quote highliting
The easiest way would be give source.python invalid.illegal.unclosed-string
a normal bg color.
{
"name": "Python unclosed string",
"scope": "source.python invalid.illegal.unclosed-string",
"background": "var(--background)", // or your background color
}
--background
may be my own defined variable so it may not exist in your color scheme. You can hardcode any color code like #000 however.
For more information, see https://www.sublimetext.com/docs/color_schemes.html
Thank you. I’ve been searching for this for far too long.
It should also be possible to change this setting from a highlight to something like an underline, right?
I’ll read through the docs, but another hint would be greatly appreciated.
{
"name": "Python unclosed string",
"scope": "source.python invalid.illegal.unclosed-string",
"background": "var(--background)", // or your background color
"font_style": "underline",
}
https://www.sublimetext.com/docs/color_schemes.html#font_style
Per the docs:
The contents of the
"variables"
and"globals"
keys are merged, with the user’s copy overwriting keys with the same name. For the"rules"
array, the user’s rules are appended.
I have added the following to my Mariana color-scheme:
"rules":
[
{
"name": "Python unclosed string",
"scope": "invalid.illegal.unclosed-string.python",
"background": "none",
}
]
The problem is that for this scope, the background applies to the area after the text (see the image at the top of this thread). So, settings like ‘foreground’ or ‘font_style’ do nothing because there is no font to adjust. Further, deleting the ‘background’ line does not do anything, because (if I understand it right) this user-defined rule is appended to the existing rule, which still has the ‘background’ statement.
This seems terribly hacky, but using “none” has eliminated that godawful orange highlight bar. That’s good enough for now.
What I would really like to see is quotes treated the same as brackets via the package BracketHighlighter. If you have any tips there, I’d really appreciate it; if not, no worries.
Thank you for your help
A stray quote doesn’t have a special scope so that’s not possible to do anything with its scope.