mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-10 12:31:50 +08:00
Add custom_expand
This commit is contained in:
@@ -118,16 +118,23 @@ function! zencoding#lang#html#parseIntoTree(abbr, type)
|
||||
let current.name = ''
|
||||
endif
|
||||
|
||||
if tag_name =~ '^\(lorem\|lipsum\)\d*$'
|
||||
if parent.name == ''
|
||||
let div = zencoding#lang#html#parseTag('<div/>')
|
||||
let div.value = '{\${' . tag_name . '}}'
|
||||
let current.snippet = zencoding#toString(div, type, 0, [])
|
||||
else
|
||||
let current.snippet = '${' . tag_name . '}'
|
||||
endif
|
||||
let current.name = ''
|
||||
let custom_expands = zencoding#getResource(type, 'custom_expands', {})
|
||||
if empty(custom_expands) && has_key(settings, 'custom_expands')
|
||||
let custom_expands = settings['custom_expands']
|
||||
endif
|
||||
for k in keys(custom_expands)
|
||||
if tag_name =~ k
|
||||
if parent.name == ''
|
||||
let div = zencoding#lang#html#parseTag('<div/>')
|
||||
let div.value = '{\${' . tag_name . '}}'
|
||||
let current.snippet = zencoding#toString(div, type, 0, [])
|
||||
else
|
||||
let current.snippet = '${' . tag_name . '}'
|
||||
endif
|
||||
let current.name = ''
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
" default_attributes
|
||||
let default_attributes = zencoding#getResource(type, 'default_attributes', {})
|
||||
|
||||
Reference in New Issue
Block a user