vim-css-color icon indicating copy to clipboard operation
vim-css-color copied to clipboard

Getting error when opening file

Open farzadmf opened this issue 4 years ago • 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

farzadmf avatar Sep 28 '20 01:09 farzadmf

What does :set secure? modeline? say

ap avatar Sep 28 '20 18:09 ap

(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@82e8c92ebef5afcac0c0fdb706ff163f9b3366f7 and then fixed in vim/vim@916a818cea5ba05a5f2117407674461b8bee6832).

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

ap avatar Sep 28 '20 18:09 ap

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

farzadmf avatar Sep 28 '20 19:09 farzadmf

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?

ap avatar Sep 29 '20 09:09 ap

Apparently, that's the case 😮 😕

farzadmf avatar Sep 29 '20 12:09 farzadmf

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 avatar Oct 22 '20 12:10 twidxuga

@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

farzadmf avatar Oct 22 '20 13:10 farzadmf

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

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

ap avatar Oct 23 '20 13:10 ap

Same with # vi: syntax=sh

asakura42 avatar Jul 11 '21 13:07 asakura42

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

adamhotep avatar Aug 27 '23 18:08 adamhotep