mirror of
https://github.com/mattn/emmet-vim.git
synced 2026-08-12 19:11:33 +08:00
Fix mergeConfig() list merge bug
When merging two lists, l:rhi is a value from iteration (not an index), so l:rhs[l:rhi] was incorrectly using values as indices. Changed to use l:rhi directly. Also removed the redundant l:lhs += l:rhs before the clear-and-rebuild loop.
This commit is contained in:
+1
-2
@@ -123,12 +123,11 @@ function! emmet#mergeConfig(lhs, rhs) abort
|
|||||||
let [l:lhs, l:rhs] = [a:lhs, a:rhs]
|
let [l:lhs, l:rhs] = [a:lhs, a:rhs]
|
||||||
if type(l:lhs) ==# 3
|
if type(l:lhs) ==# 3
|
||||||
if type(l:rhs) ==# 3
|
if type(l:rhs) ==# 3
|
||||||
let l:lhs += l:rhs
|
|
||||||
if len(l:lhs)
|
if len(l:lhs)
|
||||||
call remove(l:lhs, 0, len(l:lhs)-1)
|
call remove(l:lhs, 0, len(l:lhs)-1)
|
||||||
endif
|
endif
|
||||||
for l:rhi in l:rhs
|
for l:rhi in l:rhs
|
||||||
call add(l:lhs, l:rhs[l:rhi])
|
call add(l:lhs, l:rhi)
|
||||||
endfor
|
endfor
|
||||||
elseif type(l:rhs) ==# 4
|
elseif type(l:rhs) ==# 4
|
||||||
let l:lhs += map(keys(l:rhs), '{v:val : l:rhs[v:val]}')
|
let l:lhs += map(keys(l:rhs), '{v:val : l:rhs[v:val]}')
|
||||||
|
|||||||
Reference in New Issue
Block a user