Christian wrote:
> On Di, 10 Jul 2018, Bram Moolenaar wrote:
>
> > Patch 8.1.0177
> > Problem: Defining function in sandbox is inconsistent, cannot use
> > :function
> > but can define a lambda.
> > Solution: Allow defining a function in the sandbox, but also use the
> > sandbox
> > when executing it. (closes #3182)
>
> Now that functions in the sandbox are allowed, I wonder whether we
> should reconsider allowing setbufvar().
>
> Usecase:
>
> Count the number a pattern occurs:
>
> :%s/pattern/\=setbufvar('', 'count', get(b:, 'count', 0)+1)/gne
>
> Currently, this throws E48
>
> However I am not sure what the exact reason was, why this was forbidden
> in the first place.
Some plugins use a variable to allow defining some filter or other
expression. The plugin will then evaluate the variable, and this
usually happens outside of the sandbox. One might argue that this is a
problem of the plugin, but it's an easy mistake to make. It's a valid
concern, something similar was a security risk in the past.
I rather not be more permissive unless we know exactly what the
consequences are.
--
ZOOT: I'm afraid our life must seem very dull and quiet compared to yours.
We are but eightscore young blondes, all between sixteen and
nineteen-and-a-half, cut off in this castle, with no one to protect us.
Oooh. It is a lonely life ... bathing ... dressing ... undressing ...
making exciting underwear....
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.