mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 03:24:45 +08:00
Added emmet#isExapandable(). related issue #156
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" emmet.vim
|
" emmet.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 01-Oct-2013.
|
" Last Change: 15-Oct-2013.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -101,6 +101,18 @@ function! emmet#parseIntoTree(abbr, type)
|
|||||||
return emmet#lang#{rtype}#parseIntoTree(abbr, type)
|
return emmet#lang#{rtype}#parseIntoTree(abbr, type)
|
||||||
endfunction
|
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)
|
function! emmet#mergeConfig(lhs, rhs)
|
||||||
if type(a:lhs) == 3 && type(a:rhs) == 3
|
if type(a:lhs) == 3 && type(a:rhs) == 3
|
||||||
let a:lhs += a:rhs
|
let a:lhs += a:rhs
|
||||||
|
|||||||
Reference in New Issue
Block a user