mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
added sass compatibilty
This commit is contained in:
@@ -317,6 +317,10 @@ function! s:zen_mergeConfig(lhs, rhs)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:zen_toString_sass(settings, current, type, inline, filters, itemno, indent)
|
||||||
|
return 'sassed'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, indent)
|
function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, indent)
|
||||||
let settings = a:settings
|
let settings = a:settings
|
||||||
let current = a:current
|
let current = a:current
|
||||||
@@ -536,9 +540,13 @@ function! s:zen_toString(...)
|
|||||||
if len(snippet) > 0
|
if len(snippet) > 0
|
||||||
let tmp = substitute(snippet, '|', '${cursor}', 'g')
|
let tmp = substitute(snippet, '|', '${cursor}', 'g')
|
||||||
let tmp = substitute(tmp, '\${zenname}', current.name, 'g')
|
let tmp = substitute(tmp, '\${zenname}', current.name, 'g')
|
||||||
|
echo type
|
||||||
if type == 'css' && s:zen_useFilter(filters, 'fc')
|
if type == 'css' && s:zen_useFilter(filters, 'fc')
|
||||||
let tmp = substitute(tmp, '^\([^:]\+\):\(.*\)$', '\1: \2', '')
|
let tmp = substitute(tmp, '^\([^:]\+\):\(.*\)$', '\1: \2', '')
|
||||||
endif
|
endif
|
||||||
|
if type == 'sass' && s:zen_useFilter(filters, 'sass')
|
||||||
|
let tmp = substitute(tmp, '^\([^:]\+\):\([^;]*\);$', '\1: \2', '')
|
||||||
|
endif
|
||||||
for attr in keys(current.attr)
|
for attr in keys(current.attr)
|
||||||
let val = current.attr[attr]
|
let val = current.attr[attr]
|
||||||
let tmp = substitute(tmp, '\${' . attr . '}', val, 'g')
|
let tmp = substitute(tmp, '\${' . attr . '}', val, 'g')
|
||||||
@@ -636,7 +644,7 @@ function! zencoding#expandAbbr(mode) range
|
|||||||
if len(leader) == 0
|
if len(leader) == 0
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
let mx = '|\(\%(sass\|html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
||||||
if leader =~ mx
|
if leader =~ mx
|
||||||
let filters = split(matchstr(leader, mx)[1:], '\s*,\s*')
|
let filters = split(matchstr(leader, mx)[1:], '\s*,\s*')
|
||||||
let leader = substitute(leader, mx, '', '')
|
let leader = substitute(leader, mx, '', '')
|
||||||
@@ -707,7 +715,7 @@ function! zencoding#expandAbbr(mode) range
|
|||||||
endif
|
endif
|
||||||
let rest = getline('.')[len(line):]
|
let rest = getline('.')[len(line):]
|
||||||
let str = part
|
let str = part
|
||||||
let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
let mx = '|\(\%(sass\|html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
||||||
if str =~ mx
|
if str =~ mx
|
||||||
let filters = split(matchstr(str, mx)[1:], '\s*,\s*')
|
let filters = split(matchstr(str, mx)[1:], '\s*,\s*')
|
||||||
let str = substitute(str, mx, '', '')
|
let str = substitute(str, mx, '', '')
|
||||||
@@ -1295,7 +1303,7 @@ endfunction
|
|||||||
"==============================================================================
|
"==============================================================================
|
||||||
|
|
||||||
function! zencoding#ExpandWord(abbr, type, orig)
|
function! zencoding#ExpandWord(abbr, type, orig)
|
||||||
let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
let mx = '|\(\%(sass\|html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
|
||||||
let str = a:abbr
|
let str = a:abbr
|
||||||
let type = a:type
|
let type = a:type
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user