Hello,

If you change the background=light, Vim reloads the colorscheme so it has a
chance to give you new colors.  But if the colorscheme changes background=dark
again, then Vim knows that the colorscheme isn't capable of picking colors for
a light background.  In that case, Vim will just ignore whatever the
colorscheme says and will use default colors instead.

Therefore, your colorscheme could just read the value of 'background' and
choose appropriate colors, or it could set it the value of background to light
or dark, and choose those colors, because if Vim sees the colorscheme trying to
set 'dark' when you have just selected 'light', it ignores your colorscheme.

regards,
peter



--- [EMAIL PROTECTED] wrote:

> 
> Hi Vimmers,
> 
> Recently, I've been thinking what this option is designed for.
> 
> The document saids that:
> 
>   when 'background' is set Vim will adjust the default color groups for the
> new value. But the colors used for syntax highlighting will not change.
> 
> But in fact, I had tested and found that when I set the 'background'
> option, Vim will source the color scheme script again. The idea seems to be
> good, if the color scheme script reads the 'background' option and set a
> different color according to the option everything should work...
> 
> However, we could imagine... what will happen if I set background=light
> while the color scheme set background=dark inside the script? When we set
> background=light in command line, the script will be launched, and the
> background set to dark. then we will never be able to set background=light.
> Then, if another color scheme wants the value, it will always get
> background=dark even if the user set background=light. (Okay the "System"
> will try to set the 'background' option too, and that will more more
> confusing...)
> 
> So, is 'background' option designed so that the color scheme should not
> read or write it at all? In my opinion it is introducing more confusing
> than good if it works this way.
> 
> Could anyone explains what this option "exactly" means and what it is
> designed to and how should we use it? I've been quite confused now.
> 
> --
> Sincerely, Pan, Shi Zhu. ext: 2606
> 
> 



                
____________________________________________________ 
Do you Yahoo!? 
Spring Racing Carnival - Check out Sonia Kruger's blog
http://au.sports.yahoo.com/racing/

Reply via email to