Added emmet#isExapandable(). related issue #156

This commit is contained in:
mattn
2013-10-15 09:13:07 +09:00
parent ef2cd77d40
commit 32a1dac905

View File

@@ -1,7 +1,7 @@
"=============================================================================
" emmet.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" 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