ap/vim-css-color

Getting error when opening file

farzadmf opened this issue · 10 comments

Hi, I'm using neovim, and when opening a specific file, I'm getting this error:

Error detected while processing function css_color#init[10]..css_color#enable:
line    3:
E12: Command not allowed from exrc/vimrc in current dir or tag search: ^Iaugroup CSSColor
line    4:
E12: Command not allowed from exrc/vimrc in current dir or tag search: ^I^Iautocmd! * <buffer>
line    6:
E12: Command not allowed from exrc/vimrc in current dir or tag search: ^I^I^Iautocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen()
line   12:
E12: Command not allowed from exrc/vimrc in current dir or tag search: ^I^Iautocmd ColorScheme <buffer> call css_color#reinit()
line   13:
E12: Command not allowed from exrc/vimrc in current dir or tag search: ^Iaugroup END

To be more specific, I'm using byobu, and I'm doing nvim $( which byobu ) to open the file. The target file is /usr/bin/byobu, which is a "read-only" file.

I tried copying the file to a directory owned by me, but the error still happens. It seems that the issue is only with that specific file (which is a shell script), but I can't replicate it with any other file (even a shell script).

Any ideas what could be the issue here?

Thank you

ap commented

What does :set secure? modeline? say

ap commented

(Mainly I’m trying to see whether this is neovim #9881. Personally I haven’t had luck reproducing the issue based on the description of that bug (and the underlying Vim 8.1 bug – caused by vim/vim@82e8c92 and then fixed in vim/vim@916a818).

Either way, it seems that secure is getting set somehow.)

Thank you @ap for your reply, the output of :set secure? modeline? is this:

nosecure
  modeline

And I'm sorry about the bug description; I know it's super specific, but that's the only situation I saw the message

ap commented

Huh! That is after you get that error message? Because it acts as if secure had been set… but that output says it wasn’t actually set?

Apparently, that's the case 😮 😕

I have the exact same error. Was able to reproduce it with a simple file (test.cfg) containing the line

# vi:syntax=cfg

My secure and modeline variables are the same as @farzadmf's.

@twidxuga pointed out a good thing; I checked the file I'm opening and it has this at the end:

# vi: syntax=sh ts=4 noexpandtab
ap commented

Was able to reproduce it with a simple file containing the line

Thank you for that! I can reproduce it that way too.

Same with # vi: syntax=sh

I also have this issue and the same nosecure modeline output to that query.

The solution is to change syntax to filetype, e.g. # vi: filetype=sh