Christian Brabandt wrote:

> > > now that we have the async and timer feature, wouldn't it make sense to 
> > > have a way to check, whether Vim is in sandbox mode, so that some 
> > > functions don't randomly trigger E48 errors and can check, whether it is 
> > > okay to be executed?
> > 
> > It would be easy to add a function for this.  But before we do, can you
> > give an example of how it would be used?
> 
> Well, I use a plugin for sporadically saving unsaved buffers. This uses 
> the new timers functionality and internally uses bufdo to run over all 
> buffers. Now unfortunately this was triggered once I debugged a Vim 
> script (so the sandbox was active).
> 
> Now I could of course use :try/catch, but I rather like to avoid doing 
> anything, if I am in the sandbox. But perhaps, I should instead switch 
> to using writefile() and bufnr() instead of using :bufdo :w

Well, it won't hurt to have a sandbox() function.

-- 
ASCII stupid question, get a stupid ANSI.

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