On Wed, Jul 28, 2010 at 9:24 PM, Benjamin Fritz <fritzophre...@gmail.com> wrote:
> On Wed, Jul 28, 2010 at 3:39 PM, Bram Moolenaar <b...@moolenaar.net> wrote:
>>
>> The documentation clearly says:
>>
>> By default, HTML optimized for old browsers is generated.  If you prefer 
>> using
>> cascading style sheets (CSS1) for the attributes (resulting in considerably
>> shorter and valid HTML 4 file), use: >
>>   :let g:html_use_css = 1
>>
>> We can change that to default to using CSS when the variable isn't set
>> and tell users to use this to disable that:
>>
>>   :let g:html_use_css = 0
>>
>> Any problems with that?
>>
>
> Well...it would be inconsistent with the other options, which will
> remain enabled even if you :let them to zero. If I change this one, I
> will want to change all options to work the same way. Each would do as
> one might expect when :let to either zero or 1, with a default
> behavior noted in the :help when they are not defined at all.

I think that the best choice is just to keep the same option name and
change the behavior when it hasn't been set.  So, if the user sets
html_use_css to 0 in their vimrc, they won't get CSS, and if they have
set it to 1 or haven't set it at all, they'll get CSS.  I can't see
any good reason for adding a second variable, it seems like it would
only complicate things.  I definitely *wouldn't* write it to always be
set to 1 by default - that's too hard to override for users who aren't
intimately familiar with the order in which different vim
initializations happen.  I'd just have the plugin do this when it
runs:

if !exists("g:html_use_css")
  let html_use_css = 1
endif

That way, if the user has set it to anything in his vimrc, the plugin
never needs to do anything.  If he sets it in his gvimrc instead, he
just overwrites the default that the plugin set.

~Matt

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui