On 2017-05-08, 'Andy Wokula' via vim_dev wrote:
> Am 08.05.2017 um 12:53 schrieb Bram Moolenaar:
> >For flexibility this needs to work recursively.  We could do something
> >like:
> >
> >     let saved_options = options_save()
> >     ... do your stuff ...
> >     call options_restore(saved_options)
> >
> >The options being saved should be small to keep this efficient.  We need
> >to make a list of the ones that are useful, such as 'ignorecase' and
> >'gdefault'.
> 
> What about a different approach:
> 
> Have a mode (for debugging only) in which builtin commands and
> functions complain when options they use are not at the default
> value.  This way the script writer learns which options need to be
> set and restored.

Problems usually occur not with the options the script writer has
set to non-default values, but with options the script user has set
to non-default values.  This mode is not going to tell the writer
which options users may have set.

The safest approach, and the one most considerate of the user, is
for the plugin to save and restore the current value of any option
it depends on and sets.

Regards,
Gary

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