Rick Howe wrote:

> I found an error on patch 8.0.0736.
> With the following sample function,
> 'diffthis' and 'diffoff' will cause
> "E788: Not allowed to edit anoter buffer now"
> on 'wincmd'.
> 
> augroup xyz
>       au!
>       au OptionSet * call XYZ()
> augroup END
> 
> function! XYZ()
>       if expand('<amatch>') == 'diff'
>               let c = winnr()
>               for w in range(1, winnr('$'))
>                       exec w . 'wincmd w'
>                       echo w . ':' . &diff
>               endfor
>               exec c . 'wincmd w'
>       endif
> endfunction
> 
> The error does not happens when I removed
> ++curbuf_lock;
> --curbuf_lock;
> in set_diff_option() of diff.c.

It was an intentional change to disallow moving between windows and
buffers for the OptionSet event.

You could use a timer to call the function a bit later.

-- 
hundred-and-one symptoms of being an internet addict:
196. Your computer costs more than your car.

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