From fcfcfbfe73d397bd1bf8c2b3088878cf8df2d7a1 Mon Sep 17 00:00:00 2001 From: thawk Date: Sat, 2 Nov 2019 13:25:09 +0800 Subject: [PATCH] 'enable' of layer configuration supports expression (#3211) --- autoload/SpaceVim/custom.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/custom.vim b/autoload/SpaceVim/custom.vim index 6db35cd9f..d443d7cd4 100644 --- a/autoload/SpaceVim/custom.vim +++ b/autoload/SpaceVim/custom.vim @@ -105,7 +105,8 @@ function! SpaceVim#custom#apply(config, type) abort endif let layers = get(a:config, '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) else call SpaceVim#layers#load(layer.name, layer)