Christian Brabandt wrote:

> Bram,
> it has been mentioned, that the OptionSet autocommand is not triggered, 
> for setwinvar() function calls. Reason is, the setwinvar() function 
> calls switch_win() to switch to the window which will block 
> autocommands. 
> 
> Therefore here is a patch, that unblocks the autocommands, if an 
> optionset autocommand is defined and while I was there, I also made the 
> swich_win() function only trigger, if it will actually needs to change 
> windows or tabpages.
> 
> Attached is the patch, including a test.

I'm not sure it is such a good idea to trigger OptionSet when setting an
option in another window.  It may have nasty side effects.

Perhaps we should document how this works, and suggest using WinEnter to
check option values when needed?

> Another question has been raised. Sometimes options will get set 
> directly (e.g. diffmode). Should those place converted to use the 
> set_option_...() so that the autocommand is triggered? Currently, using 
> :diffthis does not trigger the autocommand. If so, should it be 
> triggered only for setting the diffmode or for every setting?

This whole code needs to be cleaned up.  We should consistently use the
code that checks the new value and takes care of side-effects, no matter
what command was used to set the option.  Except for the first
initialization.  Also ":set all&" should work differently.

-- 
hundred-and-one symptoms of being an internet addict:
18. Your wife drapes a blond wig over your monitor to remind you of what she
    looks like.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui