Hi Bram!
On Sa, 20 Okt 2012, Bram Moolenaar wrote:
>
> Michael Henry wrote:
>
> > The :sandbox command seems to disallow the use of :setlocal,
> > even though it permits changing buffer-local options via :set.
> > For example, this works fine:
> >
> > vim -u NONE '+set nocp | sandbox set ts=16'
> >
> > But this fails:
> >
> > vim -u NONE '+set nocp | sandbox setlocal ts=16'
> >
> > It generate the following error message:
> >
> > Error detected while processing command line:
> > E48: Not allowed in sandbox: sandbox setlocal ts=16
> >
> > I was expecting :setlocal would work with :sandbox; should it?
>
> Yes, that appears to be a bug. Not all options can be changed, for
> safety, but if :set works when :setlocal should also work.
Here is a patch:
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -832,9 +832,9 @@
EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
TRLBAR|EXTRA|NEEDARG|CMDWIN),
EX(CMD_setglobal, "setglobal", ex_set,
- TRLBAR|EXTRA|CMDWIN),
+ TRLBAR|EXTRA|CMDWIN|SBOXOK),
EX(CMD_setlocal, "setlocal", ex_set,
- TRLBAR|EXTRA|CMDWIN),
+ TRLBAR|EXTRA|CMDWIN|SBOXOK),
EX(CMD_sfind, "sfind", ex_splitview,
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_sfirst, "sfirst", ex_rewind,
regards,
Christian
--
Im Kanal wurde eine in einem Sack fest verschnürte Leiche
gefunden. Selbstmord scheint ausgeschlossen.
--
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