mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
set cursor position.
This commit is contained in:
@@ -906,9 +906,9 @@ function! s:zen_toString(...)
|
|||||||
let str .= " />\n"
|
let str .= " />\n"
|
||||||
else
|
else
|
||||||
if stridx(','.s:zen_settings[type]['block_elements'].',', ','.current['name'].',') != -1 && len(current['child'])
|
if stridx(','.s:zen_settings[type]['block_elements'].',', ','.current['name'].',') != -1 && len(current['child'])
|
||||||
let str .= ">\n</" . current['name'] . ">\n"
|
let str .= ">\n|</" . current['name'] . ">\n"
|
||||||
else
|
else
|
||||||
let str .= "></" . current['name'] . ">\n"
|
let str .= ">|</" . current['name'] . ">\n"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -938,6 +938,9 @@ function! s:zen_expand()
|
|||||||
let items = s:zen_parseIntoTree(part, type)['child']
|
let items = s:zen_parseIntoTree(part, type)['child']
|
||||||
let expand = len(items) ? s:zen_toString(items[0], type) : ''
|
let expand = len(items) ? s:zen_toString(items[0], type) : ''
|
||||||
if len(expand)
|
if len(expand)
|
||||||
|
let expand = substitute(expand, '|', '$cursor$', '')
|
||||||
|
let expand = substitute(expand, '|', '', 'g')
|
||||||
|
let expand = substitute(expand, '\$cursor\$', '|', '')
|
||||||
if expand !~ '|'
|
if expand !~ '|'
|
||||||
let expand .= '|'
|
let expand .= '|'
|
||||||
endif
|
endif
|
||||||
@@ -962,7 +965,7 @@ function! ZenExpand(abbr, type)
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
inoremap <plug>ZenCodingExpand <c-r>=<sid>zen_expand()<cr><esc>?\|<cr>a<bs>
|
inoremap <plug>ZenCodingExpand <c-r>=<sid>zen_expand()<cr><esc>/\|<cr>a<bs>
|
||||||
imap <c-z>, <plug>ZenCodingExpand
|
imap <c-z>, <plug>ZenCodingExpand
|
||||||
|
|
||||||
function! s:zen_mergeConfig(lhs, rhs)
|
function! s:zen_mergeConfig(lhs, rhs)
|
||||||
|
|||||||
Reference in New Issue
Block a user