Expand paren

This commit is contained in:
mattn
2013-09-25 22:56:34 +09:00
parent 9c17334509
commit f8095a65dd

View File

@@ -18,6 +18,13 @@ function! emmet#lang#css#parseIntoTree(abbr, type)
" emmet
let tokens = split(abbr, '+\ze[^+)!]')
let block = emmet#util#searchRegion("{", "}")
if block[0] == [0,0] && block[1] == [0,0]
let current = emmet#newNode()
let current.snippet = abbr . " {\n\t${cursor}\n}"
let current.name = ''
call add(root.child, deepcopy(current))
else
for n in range(len(tokens))
let token = tokens[n]
let prop = matchlist(token, '^\(-\{0,1}[a-zA-Z]\+\|[a-zA-Z0-9]\++\{0,1}\|([a-zA-Z0-9]\++\{0,1})\)\(\%([0-9.-]\+[pe]\{0,1}-\{0,1}\|-auto\)*\)$')
@@ -73,7 +80,6 @@ function! emmet#lang#css#parseIntoTree(abbr, type)
let snippet_name = tag_name
if !has_key(snippets, snippet_name)
let pat = '^' . join(split(tag_name, '\zs'), '\%(\|[^:-]\+-\)')
let g:hoge = pat
let vv = filter(sort(keys(snippets)), 'snippets[v:val] =~ pat')
if len(vv) > 0
let snippet_name = vv[0]
@@ -135,6 +141,7 @@ function! emmet#lang#css#parseIntoTree(abbr, type)
call add(root.child, current)
endif
endfor
endif
return root
endfunction