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:
Yasuhiro Matsumoto
2026-03-07 16:44:58 +09:00
parent edb1941955
commit 8623326f4c

View File

@@ -123,12 +123,11 @@ function! emmet#mergeConfig(lhs, rhs) abort
let [l:lhs, l:rhs] = [a:lhs, a:rhs]
if type(l:lhs) ==# 3
if type(l:rhs) ==# 3
let l:lhs += l:rhs
if len(l:lhs)
call remove(l:lhs, 0, len(l:lhs)-1)
endif
for l:rhi in l:rhs
call add(l:lhs, l:rhs[l:rhi])
call add(l:lhs, l:rhi)
endfor
elseif type(l:rhs) ==# 4
let l:lhs += map(keys(l:rhs), '{v:val : l:rhs[v:val]}')