fix merge configuration

This commit is contained in:
Yasuhiro Matsumoto
2015-10-20 10:12:03 +09:00
parent 13b842d9c4
commit 0bd0a38a29
+17 -2
View File
@@ -126,7 +126,8 @@ endfunction
function! emmet#mergeConfig(lhs, rhs) abort function! emmet#mergeConfig(lhs, rhs) abort
let [lhs, rhs] = [a:lhs, a:rhs] let [lhs, rhs] = [a:lhs, a:rhs]
if type(lhs) ==# 3 && type(rhs) ==# 3 if type(lhs) ==# 3
if type(rhs) ==# 3
let lhs += rhs let lhs += rhs
if len(lhs) if len(lhs)
call remove(lhs, 0, len(lhs)-1) call remove(lhs, 0, len(lhs)-1)
@@ -134,7 +135,20 @@ function! emmet#mergeConfig(lhs, rhs) abort
for rhi in rhs for rhi in rhs
call add(lhs, rhs[rhi]) call add(lhs, rhs[rhi])
endfor endfor
elseif type(lhs) ==# 4 && type(rhs) ==# 4 elseif type(rhs) ==# 4
let lhs += map(keys(rhs), '{v:val : rhs[v:val]}')
endif
elseif type(lhs) ==# 4
if type(rhs) ==# 3
for V in rhs
if type(V) != 4
continue
endif
for VV in keys(V)
let lhs[VV] = V[VV]
endfor
endfor
elseif type(rhs) ==# 4
for key in keys(rhs) for key in keys(rhs)
if type(rhs[key]) ==# 3 if type(rhs[key]) ==# 3
if !has_key(lhs, key) if !has_key(lhs, key)
@@ -158,6 +172,7 @@ function! emmet#mergeConfig(lhs, rhs) abort
endif endif
endfor endfor
endif endif
endif
endfunction endfunction
function! emmet#newNode() abort function! emmet#newNode() abort