lookup base type

This commit is contained in:
Yasuhiro Matsumoto
2016-10-29 22:57:32 +09:00
parent b56be291c4
commit 30d58ee417
2 changed files with 27 additions and 21 deletions

View File

@@ -9,3 +9,18 @@ function! emmet#lang#exists(type) abort
return s:exists[a:type]
endfunction
function! emmet#lang#type(type) abort
let type = a:type
let base = type
let settings = emmet#getSettings()
while base != ''
if emmet#lang#exists(base)
return base
endif
if !has_key(settings[base], 'extends')
break
endif
let base = settings[base].extends
endwhile
return 'html'
endfunction