1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00

'enable' of layer configuration supports expression (#3211)

This commit is contained in:
thawk 2019-11-02 13:25:09 +08:00 committed by Wang Shidong
parent aa893b2859
commit fcfcfbfe73

View File

@ -105,7 +105,8 @@ function! SpaceVim#custom#apply(config, type) abort
endif endif
let layers = get(a:config, 'layers', []) let layers = get(a:config, 'layers', [])
for layer in layers for layer in layers
if !get(layer, 'enable', 1) let enable = get(layer, 'enable', 1)
if (type(enable) == type('') && !eval(enable)) || (type(enable) != type('') && !enable)
call SpaceVim#layers#disable(layer.name) call SpaceVim#layers#disable(layer.name)
else else
call SpaceVim#layers#load(layer.name, layer) call SpaceVim#layers#load(layer.name, layer)