I was writting my own formatexpr (please, see
http://vimgcwsyntax.google.com/), 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.
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?
Vim version here is 7.2.411.
Thank you!
--
Silas Silva
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
Yeah, that is! In my simple project (right URL below), you can see the
code I'm writting (preliminary versions have still ugly code) and make
criticism.
>
> >(please, see http://vimgcwsyntax.google.com/),
>
> Server not found
Ah, sorry, http://vimgcwsyntax.googlecode.com/
> :h 'debug
Thanks, that really helps a lot.
> You were almost there:
> :h sandbox-option
Got the idea. It depends where formaexpr (and other options) is set.
Thank you again.
--
Silas Silva