Arnaud Decara wrote:

> Please find attached a patch.
> 
> MOTIVATION
> The local options for which invalid values have
> been defined have actually their values checked
> only for local variables but not for global ones.
> It matters because global variables of local
> options might be used for the initialization of
> new local variables.
> 
> EXAMPLE
> 1) Open Vim as you want
> 2) :e one
> 3) :setglobal foldcolumn=20
> 4) :e two
> 5) :setlocal foldcolumn?
> Result>  foldcolumn=20
> (foldcolumn is supposed to take values between 0
> and 12).
> 
> PATCH
> This patch guarantees that the global and local
> variables of all the NUMERIC local options take
> only valid values (or more precisely : values that
> are currently considered/defined as valid, see
> TODO(*)).
> In addition, the special cases (for example when
> 'scroll' is set to 0), which were only handled for
> local variables, are now handled for global
> variables too when relevant.
> 
> For reference, the numeric local options for which
> some invalid values are currently defined (which
> are the only options for which I added some
> changes) are:
> 'iminsert'
> 'imsearch'
> 'shiftwidth'
> 'tabstop'
> 'textwidth'
> --
> 'conceallevel'
> 'foldcolumn'
> 'foldlevel'
> 'numberwidth'
> 'scroll'
> (the first five are local to buffers, the five
> following are local to windows).

Thanks, I'll check out the patch.

> TODO
> The same should be done for STRING local options
> and maybe also for some string global-local
> options ('undolevel' which is the only numeric
> global-local option doesn't have any invalid value
> defined).
> 
> (*)We could also define some invalid values for the
> other numeric local options: 
> 'softtabstop'
> 'synmaxcol'
> 'wrapmargin'
> --
> 'foldminlines'
> 'foldnestmax'.
> Indeed, negative values don't make much sense for
> these options (except for 'softtabstop' but we
> could still forbid values strictly inferior to -1).

It's good to warn the user for doing something that won't work.
But we also don't want to break any existing plugins.

-- 
hundred-and-one symptoms of being an internet addict:
266. You hear most of your jokes via e-mail instead of in person.

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