Case-insensitive type string matching

Fixing the plugin for Vim 7.4 (Travis)
This commit is contained in:
jpsouzasilva
2018-08-28 23:46:27 -03:00
parent ca2b158737
commit 9cce773acb

View File

@@ -377,19 +377,20 @@ endfunction
function! emmet#getFileType(...) abort
let flg = get(a:000, 0, 0)
if has_key(s:emmet_settings, &filetype)
return &filetype
endif
let pos = emmet#util#getcurpos()
let type = synIDattr(synID(pos[1], pos[2], 1), 'name')
if type =~# '^css\w'
if type =~? '^css\w'
let type = 'css'
elseif type =~# '^html\w'
elseif type =~? '^html\w'
let type = 'html'
elseif type =~# '^js\w'
elseif type =~? '^js\w' || '^javascript'
let type = 'javascript'
elseif type =~# '^xml'
elseif type =~? '^xml'
let type = 'xml'
else
if has_key(s:emmet_settings, &filetype)
let type = &filetype
else
let types = split(&filetype, '\.')
for part in types
@@ -409,7 +410,6 @@ function! emmet#getFileType(...) abort
endif
endfor
endif
endif
return len(type) == 0 ? 'html' : type
endfunction