From 3be94c489fd837d08276c5e5fc09f7a1890d3b5a Mon Sep 17 00:00:00 2001 From: Ricardo Villagrana Date: Tue, 8 Oct 2024 09:00:07 -0600 Subject: [PATCH 1/2] refs #561: fixes Invalid type for len() error This error is thrown because in some cases the len() argument is not an String and can lead to invalid type errors. --- autoload/emmet.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/emmet.vim b/autoload/emmet.vim index e242bea0..fdfbb267 100644 --- a/autoload/emmet.vim +++ b/autoload/emmet.vim @@ -202,7 +202,7 @@ function! emmet#toString(...) abort else let type = &filetype endif - if len(type) ==# 0 | let type = 'html' | endif + if type ==# '' | let type = 'html' | endif if a:0 > 2 let inline = a:3 else @@ -430,7 +430,7 @@ function! emmet#getFileType(...) abort endfor endif - return len(type) == 0 ? 'html' : type + return type == '' ? 'html' : type endfunction function! emmet#getDollarExprs(expand) abort From 16eec334c010224bafb9c7f2ede2e779e0a02ea8 Mon Sep 17 00:00:00 2001 From: Ricardo Villagrana Date: Fri, 26 Sep 2025 21:47:42 -0600 Subject: [PATCH 2/2] use instead of --- plugin/emmet.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/emmet.vim b/plugin/emmet.vim index 334bcfb2..affffd36 100644 --- a/plugin/emmet.vim +++ b/plugin/emmet.vim @@ -15,7 +15,7 @@ " +------------------------------------- " | html:5_ " +------------------------------------- -" "_" is a cursor position. and type "," (Ctrl+y and Comma) +" "_" is a cursor position. and type "," (Ctrl+y and Comma) " NOTE: Don't worry about key map. you can change it easily. " +------------------------------------- " | @@ -34,7 +34,7 @@ " +------------------------------------- " | div#foo$*2>div.bar " +------------------------------------- -" And type "," +" And type "," " +------------------------------------- " |
" |
_
@@ -92,7 +92,7 @@ if !exists('g:emmet_curl_command') endif if !exists('g:user_emmet_leader_key') - let g:user_emmet_leader_key = '' + let g:user_emmet_leader_key = '' endif function! s:install_plugin(mode, buffer)