From edb1941955bdab6961c0431a36b75e9ecd5ef3a8 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 7 Mar 2026 16:44:38 +0900 Subject: [PATCH] Fix duplicate mergeLines() definition The second definition without 'range' was overwriting the first one, causing the visual selection merge to not work properly. Removed the duplicate and kept the lang-delegating version. --- autoload/emmet.vim | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/autoload/emmet.vim b/autoload/emmet.vim index 23e331b..1a9149e 100644 --- a/autoload/emmet.vim +++ b/autoload/emmet.vim @@ -855,10 +855,9 @@ function! emmet#splitJoinTag() abort endfunction function! emmet#mergeLines() range abort - let l:lines = join(map(getline(a:firstline, a:lastline), 'matchstr(v:val, "^\\s*\\zs.*\\ze\\s*$")'), '') - let l:indent = substitute(getline('.'), '^\(\s*\).*', '\1', '') - silent! exe 'normal! gvc' - call setline('.', l:indent . l:lines) + let l:type = emmet#getFileType() + call emmet#lang#{emmet#lang#type(l:type)}#mergeLines() + return '' endfunction function! emmet#removeTag() abort @@ -867,12 +866,6 @@ function! emmet#removeTag() abort return '' endfunction -function! emmet#mergeLines() abort - let l:type = emmet#getFileType() - call emmet#lang#{emmet#lang#type(l:type)}#mergeLines() - return '' -endfunction - function! emmet#anchorizeURL(flag) abort let l:mx = 'https\=:\/\/[-!#$%&*+,./:;=?@0-9a-zA-Z_~]\+' let l:pos1 = searchpos(l:mx, 'bcnW')