forked from VimPlug/emmet-vim
Support 's' filter. Close #231
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:filtermx = '|\(\%(bem\|html\|haml\|slim\|e\|c\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$'
|
||||
let s:filtermx = '|\(\%(bem\|html\|haml\|slim\|e\|c\|s\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$'
|
||||
|
||||
function! emmet#getExpandos(type, key)
|
||||
let expandos = emmet#getResource(a:type, 'expandos', {})
|
||||
@@ -640,7 +640,12 @@ function! emmet#expandAbbr(mode, abbr) range
|
||||
let indent = ''
|
||||
endif
|
||||
let expand = substitute(expand, '\n\s*$', '', 'g')
|
||||
let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest
|
||||
if emmet#useFilter(filters, 's')
|
||||
let epart = substitute(expand, "\n\s\*", "", 'g')
|
||||
else
|
||||
let epart = substitute(expand, "\n", "\n" . indent, 'g')
|
||||
endif
|
||||
let expand = line[:-len(part)-1] . epart . rest
|
||||
let lines = split(expand, "\n", 1)
|
||||
if a:mode == 2
|
||||
silent! exe "normal! gvc"
|
||||
@@ -855,6 +860,9 @@ function! emmet#expandWord(abbr, type, orig)
|
||||
let expand = substitute(expand, '<', '\<', 'g')
|
||||
let expand = substitute(expand, '>', '\>', 'g')
|
||||
endif
|
||||
if emmet#useFilter(filters, 's')
|
||||
let expand = substitute(expand, "\n\s\*", "", 'g')
|
||||
endif
|
||||
if a:orig == 0
|
||||
let expand = emmet#expandDollarExpr(expand)
|
||||
let expand = substitute(expand, '\${cursor}', '', 'g')
|
||||
|
||||
Reference in New Issue
Block a user