Friday, July 23, 2010

Re: Questions on formatexpr, sandbox and errors

Am 23.07.2010 02:37, schrieb Silas Silva:
> Hi all,
>
> I was writting my own formatexpr

which can become very difficult, good luck.

> (please, see http://vimgcwsyntax.google.com/),

Server not found

> but found some difficulties that I summarize below:

> 1. First and most important one is that I don't get any errors that
> occur inside my FormatExpr() function when it is called from
> formatexpr (although I get errors when I call it from : ). Why? Is
> it because it is executed in a sandbox environment? Is it possible
> to disable this feature? If not, what is the common way to debug
> formatexpr functions? I attached a simplified .vimrc, that shows the
> problem.

:h 'debug

> 2. :he formatexpr says: "The expression may be evaluated in the
> |sandbox|". It says *may be*. Sorry, English is not my native
> language... When you use may, it means that it is optional? If so,
> how disable/enable that?
>
> 3. :he sandbox says: "These items are not allowed in the sanbox: ...
> - changing the buffer text", but from a formatexpr function, it is
> always changed with append() and setline(). How to explain that?

You were almost there:
:h sandbox-option

> Vim version here is 7.2.411.
>
> Thank you!

--
Andy

--
You received this message from the "vim_use" 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

No comments:

Post a Comment