Title of the question pretty much describes the problem
In my vimrc file i even typed this:
let python_highlight_all = 0
But this does not help at all
UPD: I got it to work with monkeypatch in python.vim. I just commented this line:
syn match pythonSpaceError display excludenl "\s\+$"
If someone has a better solution please answer
Here are at least 2 possible reasons for this:
python_highlight_all
is definedpython_space_error_highlight
is definedSince the problem is gone if you monkeypatch syntax/python.vim
this highlight should be coming from Vim's default Python syntax file.
In the syntax file, the highlight is controlled by the code below:
# vim80/syntax/python.vim
if exists("python_highlight_all")
...
let python_space_error_highlight = 1
endif
With this code, python_space_error_highlight
is enabled if a variable python_highlight_all
exists regardless of its value.
So probably python_highlight_all
and/or python_space_error_highlight
is defined somewhere.
How's the result if you add the code below to your vimrc?
if exists('python_highlight_all')
unlet python_highlight_all
endif
if exists('python_space_error_highlight')
unlet python_space_error_highlight
endif
In $VIMRUNTIME/syntax/python.vim
, the pythonSpaceError
syntax group is surrounded by an if exists("python_space_error_highlight")
conditional (in Vim 8.0; using a syntax file from 2016 Oct 29).
So, there's no need to monkey-patch, you can indeed turn this off, by defining neither python_space_error_highlight
nor python_highlight_all
(because the latter definition will automatically define the former, too).
(Even when a config value is 0
, as the script just tests for the existence of the variable (which is odd and against the usual convention; you may want to complain about this to the script's author). Therefore, ensure that you don't have of those config variables set, and it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With