On 2018-09-20, Bram Moolenaar wrote:
> Gary Johnson wrote:
>
> > > > I discovered that the outputs were correct up to a point, then the
> > > > values of v:option_old and v:option_new became empty. That occurred
> > > > after the following autocommand.
> > > >
> > > > autocmd OptionSet diff if &diff && !exists("g:ve") | let g:ve = &ve
> > > > | set ve=all | endif
> > > >
> > > > I don't know what's going on, but something in that autocommand
> > > > causes v:option_old and v:option_new to be cleared.
> > >
> > > It's the ":set ve=all" command, it tries triggering OptionSet again,
> > > which probably doesn't do anything because of nesting, but it does clear
> > > the v:option_new and v:option_old variables.
> > >
> > > Perhaps we can do this:
> > >
> > > --- git/vim81/src/option.c 2018-09-13 20:31:47.111018149 +0200
> > > +++ option.c 2018-09-19 23:18:45.761370196 +0200
> > ...
> >
> > After applying that patch, the OptionSet event doesn't appear to be
> > triggered at all. I executed the following:
> >
> > :autocmd OptionSet diff echo "OptionSet diff" v:option_old v:option_new
> > :autocmd OptionSet * echo "OptionSet any" v:option_old v:option_new
> > :autocmd OptionSet * echom "OptionSet any" v:option_old v:option_new
> >
> > and tried setting and unsetting 'diff' and 'number' and never saw
> > a message.
>
> This should work better:
Yes, it seems to. Thank you.
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.