From 8623326f4cb0d7d0fbbc79e4a11b1f9d25f1331f Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 7 Mar 2026 16:44:58 +0900 Subject: [PATCH] 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. --- autoload/emmet.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoload/emmet.vim b/autoload/emmet.vim index 1a9149e..697ccb2 100644 --- a/autoload/emmet.vim +++ b/autoload/emmet.vim @@ -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]}')