forked from VimPlug/emmet-vim
Expand paren
This commit is contained in:
@@ -18,6 +18,13 @@ function! emmet#lang#css#parseIntoTree(abbr, type)
|
|||||||
|
|
||||||
" emmet
|
" emmet
|
||||||
let tokens = split(abbr, '+\ze[^+)!]')
|
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))
|
for n in range(len(tokens))
|
||||||
let token = tokens[n]
|
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\)*\)$')
|
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
|
let snippet_name = tag_name
|
||||||
if !has_key(snippets, snippet_name)
|
if !has_key(snippets, snippet_name)
|
||||||
let pat = '^' . join(split(tag_name, '\zs'), '\%(\|[^:-]\+-\)')
|
let pat = '^' . join(split(tag_name, '\zs'), '\%(\|[^:-]\+-\)')
|
||||||
let g:hoge = pat
|
|
||||||
let vv = filter(sort(keys(snippets)), 'snippets[v:val] =~ pat')
|
let vv = filter(sort(keys(snippets)), 'snippets[v:val] =~ pat')
|
||||||
if len(vv) > 0
|
if len(vv) > 0
|
||||||
let snippet_name = vv[0]
|
let snippet_name = vv[0]
|
||||||
@@ -135,6 +141,7 @@ function! emmet#lang#css#parseIntoTree(abbr, type)
|
|||||||
call add(root.child, current)
|
call add(root.child, current)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
endif
|
||||||
return root
|
return root
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user