From 3be94c489fd837d08276c5e5fc09f7a1890d3b5a Mon Sep 17 00:00:00 2001 From: Ricardo Villagrana Date: Tue, 8 Oct 2024 09:00:07 -0600 Subject: [PATCH] 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 e242bea..fdfbb26 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