Closed lifecrisis closed 5 years ago
Thank you for the report. That is obviously silly… now that you point it out.
I didn’t like your suggested fix because I felt that it doesn’t address the underlying reason why this mistake snuck in in the first place. The problem is that the conditional is trying to check for requirements, but it’s written as a check for the negation of any requirement. The repeated negation and identical operator makes it hard to notice that logically there ought to be a subgrouping. Factoring out the negation makes these cases need different operators so the condition becomes much clearer to read:
if ! ( v:version >= 700 && has('syntax') && ( has('gui_running') || has('nvim') || &t_Co == 256 ) )
Also: I would like to request that something like the following be placed at the top of this script, but below the feature tests:
I agree in principle but it will be (slightly) tricky to do in this plugin. Can you make another issue for further discussion please?
I agree in principle but it will be (slightly) tricky to do in this plugin. Can you make another issue for further discussion please?
See #111.
In
autoload/css_color.vim
, the feature tests at the top of the script should be regrouped.The test appears as follows:
Notice that an instance of Vim may have
&t_Co == 8
and still satisfyhas('syntax')
. Thus, the test should be:When this plugin is used with 8-color terminals, you get odd effects like the following picture:
... notice that the word "blue" is off-color.
Also: I would like to request that something like the following be placed at the top of this script, but below the feature tests:
This boilerplate is available in almost all plugins. This would allow users to globally disable the plugin even though it's installed in their
&runtimepath
. This is useful when you use the same Vim configuration in a lot of contexts and want to skip loading this plugin sometimes.