mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
Case-insensitive type string matching
Fixing the plugin for Vim 7.4 (Travis)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user