LucHermitte / local_vimrc

Per project/tree configuration plugins
GNU General Public License v3.0
125 stars 7 forks source link

Whitelist doesn't work as advertized #16

Open SoftwareApe opened 5 years ago

SoftwareApe commented 5 years ago
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?

LucHermitte commented 5 years ago

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)

SoftwareApe commented 5 years ago

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.

LucHermitte commented 5 years ago

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
SoftwareApe commented 5 years ago

Hello Luc,

I tried all three options I get

E117: Unknown function: lh#local_vimrc#lists

SoftwareApe commented 5 years ago

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.