forked from VimPlug/emmet-vim
fix merge configuration
This commit is contained in:
+17
-2
@@ -126,7 +126,8 @@ endfunction
|
||||
|
||||
function! emmet#mergeConfig(lhs, rhs) abort
|
||||
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
|
||||
if len(lhs)
|
||||
call remove(lhs, 0, len(lhs)-1)
|
||||
@@ -134,7 +135,20 @@ function! emmet#mergeConfig(lhs, rhs) abort
|
||||
for rhi in rhs
|
||||
call add(lhs, rhs[rhi])
|
||||
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)
|
||||
if type(rhs[key]) ==# 3
|
||||
if !has_key(lhs, key)
|
||||
@@ -158,6 +172,7 @@ function! emmet#mergeConfig(lhs, rhs) abort
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! emmet#newNode() abort
|
||||
|
||||
Reference in New Issue
Block a user