Open asdfzdfj opened 1 year ago
I get a similar error when I open help in neovim 0.10.0:
Error detected while processing modelines[272]..OptionSet Autocommands for "tabstop"..function indent_guides#process_autoc
mds[2]..indent_guides#enable[8]..indent_guides#init_script_vars[7]..indent_guides#capture_highlight:
line 1:
E12: Command not allowed in secure mode in current dir or tag search
E12: Command not allowed in secure mode in current dir or tag search
PR https://github.com/preservim/vim-indent-guides/pull/158 does fix my problem.
sample error text (slightly edited for readability):
steps to reproduce (approx).:
:e
command)looks like when this plugin is triggered from OptionSet event via modeline, it is run inside sandbox where
indent_guides#capture_highlight()
function errors out becauseexecute()
function is not allowed inside sandbox.https://github.com/preservim/vim-indent-guides/blob/9a106c73f64b16f898276ca87cd55326a2e5cf4c/autoload/indent_guides.vim#L255-L259
one possible solution is to use some function like
synIDattr()
and related functions (synIDtrans()
,hlID()
) to directly query any needed highlight color values instead ofexecute()
ing and parsing:highlight
output.those functions exists in regular vim for quite some time and appears to be sandbox safe, so it should be safe to use.