diff --git a/autoload/emmet.vim b/autoload/emmet.vim index cd367e6..7fe362a 100644 --- a/autoload/emmet.vim +++ b/autoload/emmet.vim @@ -1,7 +1,7 @@ "============================================================================= " emmet.vim " Author: Yasuhiro Matsumoto -" Last Change: 01-Oct-2013. +" Last Change: 15-Oct-2013. let s:save_cpo = &cpo set cpo&vim @@ -101,6 +101,18 @@ function! emmet#parseIntoTree(abbr, type) return emmet#lang#{rtype}#parseIntoTree(abbr, type) endfunction +function! emmet#isExpandable() + let line = getline('.') + if col('.') < len(line) + let line = matchstr(line, '^\(.*\%'.col('.').'c\)') + endif + let part = matchstr(line, '\(\S.*\)$') + let type = emmet#getFileType() + let ftype = emmet#lang#exists(type) ? type : 'html' + let part = emmet#lang#{ftype}#findTokens(part) + return len(part) > 0 +endfunction + function! emmet#mergeConfig(lhs, rhs) if type(a:lhs) == 3 && type(a:rhs) == 3 let a:lhs += a:rhs