local_vimrc icon indicating copy to clipboard operation
local_vimrc copied to clipboard

Whitelist doesn't work as advertized

Open SoftwareApe opened this issue 6 years ago • 5 comments

let lh#local_vimrc#lists().whitelist =...

results in

E121: Undefined variable: lh#local_vimrc#lists

let g:local_vimrc_options.whitelist =...

Results in

E121: Undefined variable: g:local_vimrc_options

call lh#local_vimrc#munge('whitelist', ...)

Results in

E117: Unknown function: lh#local_vimrc#munge

How do you configure the whitelist?

SoftwareApe avatar Oct 08 '19 12:10 SoftwareApe

let lh#local_vimrc#lists ().whitelist = ...

results in

E121: Undefined variable: lh#local_vimrc#lists

I see an extra space, before the opening brace.

Is it a copy-paste error? If not, could you try without the extra space? (Otherwise Vim will not understand we want to execute an autoload-function)

LucHermitte avatar Oct 08 '19 13:10 LucHermitte

Thank you for the quick response. That was just a copy-paste error. Just in case I tried again and received the same error message.

SoftwareApe avatar Oct 08 '19 13:10 SoftwareApe

My mistake.

It seems we cannot execute (anymore?)

let func().key = something

The time I think about a neater way to proceed, the following ways should work

a) Use a reference to the whitelist

let w = lh#local_vimrc#lists().whitelist
let w += ['/foo/bar'] " OK: I modify the list referenced
let w = [] " not OK: I modify the list to be pointed by w

b) Use a reference to all the lists

let lists = lh#local_vimrc#lists()
let lists.whitelist = whatever " OK

c) Make sure the actual option is initialized by forcing the autoload plugin to be loaded

call lh#local_vimrc#lists()
let g:local_vimrc_options.whitelist = whatever " OK

LucHermitte avatar Oct 08 '19 13:10 LucHermitte

Hello Luc,

I tried all three options I get

E117: Unknown function: lh#local_vimrc#lists

SoftwareApe avatar Oct 08 '19 13:10 SoftwareApe

Ah, I found if you do this config after Vundle is done it works. It only appears deactivated when done with Vundle. This was a bit surprising since let g:local_vimrc = ['.lvimrc'] still works.

Maybe this could be added as a comment next to the code line.

SoftwareApe avatar Oct 08 '19 13:10 SoftwareApe