forked from VimPlug/emmet-vim
fixed behavior in 'a+b'.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 19-Feb-2010.
|
" Last Change: 19-Feb-2010.
|
||||||
" Version: 0.6
|
" Version: 0.7
|
||||||
" WebPage: http://github.com/mattn/zencoding-vim
|
" WebPage: http://github.com/mattn/zencoding-vim
|
||||||
" Description: vim plugins for HTML and CSS hi-speed coding.
|
" Description: vim plugins for HTML and CSS hi-speed coding.
|
||||||
" SeeAlso: http://code.google.com/p/zen-coding/
|
" SeeAlso: http://code.google.com/p/zen-coding/
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
" script type: plugin
|
" script type: plugin
|
||||||
|
|
||||||
if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim)
|
if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim)
|
||||||
"finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_zencoding_vim = 1
|
let g:loaded_zencoding_vim = 1
|
||||||
|
|
||||||
@@ -854,9 +854,6 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
endif
|
endif
|
||||||
call add(parent['child'], current)
|
call add(parent['child'], current)
|
||||||
let last = current
|
let last = current
|
||||||
if len(tag_name) == 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
if 0
|
if 0
|
||||||
echo "str=".str
|
echo "str=".str
|
||||||
echo "operator=".operator
|
echo "operator=".operator
|
||||||
@@ -866,6 +863,9 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
echo "multiplier=".multiplier
|
echo "multiplier=".multiplier
|
||||||
echo "\n"
|
echo "\n"
|
||||||
endif
|
endif
|
||||||
|
if len(tag_name) == 0
|
||||||
|
break
|
||||||
|
endif
|
||||||
let abbr = substitute(strpart(abbr, len(match)), '^\s*', '', '')
|
let abbr = substitute(strpart(abbr, len(match)), '^\s*', '', '')
|
||||||
endwhile
|
endwhile
|
||||||
return root
|
return root
|
||||||
@@ -940,7 +940,10 @@ function! s:zen_expand()
|
|||||||
let rest = getline('.')[col('.')-1:]
|
let rest = getline('.')[col('.')-1:]
|
||||||
let type = &ft
|
let type = &ft
|
||||||
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 = ''
|
||||||
|
for item in items
|
||||||
|
let expand .= s:zen_toString(item, type)
|
||||||
|
endfor
|
||||||
if len(expand)
|
if len(expand)
|
||||||
let expand = substitute(expand, '|', '$cursor$', '')
|
let expand = substitute(expand, '|', '$cursor$', '')
|
||||||
let expand = substitute(expand, '|', '', 'g')
|
let expand = substitute(expand, '|', '', 'g')
|
||||||
@@ -966,8 +969,11 @@ endfunction
|
|||||||
|
|
||||||
function! ZenExpand(abbr, type)
|
function! ZenExpand(abbr, type)
|
||||||
let items = s:zen_parseIntoTree(a:abbr, a:type)['child']
|
let items = s:zen_parseIntoTree(a:abbr, a:type)['child']
|
||||||
if len(items) | return s:zen_toString(items[0], a:type) | endif
|
let expand = ''
|
||||||
return ''
|
for item in items
|
||||||
|
let expand .= s:zen_toString(item, a:type)
|
||||||
|
endfor
|
||||||
|
return expand
|
||||||
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>
|
||||||
@@ -1010,6 +1016,6 @@ endif
|
|||||||
"echo ZenExpand('req', 'perl')
|
"echo ZenExpand('req', 'perl')
|
||||||
"echo ZenExpand('html:4t>div#wrapper>div#header+div#contents+div#footer', '')
|
"echo ZenExpand('html:4t>div#wrapper>div#header+div#contents+div#footer', '')
|
||||||
"echo ZenExpand('a[href=http://www.google.com/].foo#hoge', '')
|
"echo ZenExpand('a[href=http://www.google.com/].foo#hoge', '')
|
||||||
"echo ZenExpand('b', '')
|
"echo ZenExpand('a+b', '')
|
||||||
|
|
||||||
" vim:set et:
|
" vim:set et:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ script_name: ZenCoding.vim
|
|||||||
script_id: '2981'
|
script_id: '2981'
|
||||||
script_type: utility
|
script_type: utility
|
||||||
script_package: zencoding.vim
|
script_package: zencoding.vim
|
||||||
script_version: '0.6'
|
script_version: '0.7'
|
||||||
required_vim_version: '7.0'
|
required_vim_version: '7.0'
|
||||||
summary: vim plugins for HTML and CSS hi-speed coding.
|
summary: vim plugins for HTML and CSS hi-speed coding.
|
||||||
|
|
||||||
@@ -67,8 +67,10 @@ install_details: |
|
|||||||
copy zencoding.vim to your plugin directory.
|
copy zencoding.vim to your plugin directory.
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
|
- '0.7': |
|
||||||
|
This is an upgrade for ZenCoding.vim: fixed behavior in 'a+b'.
|
||||||
- '0.6': |
|
- '0.6': |
|
||||||
This is an upgrade for ZenCoding.vim: fixed strange behaviour about '<a href="">b_</a>'
|
This is an upgrade for ZenCoding.vim: fixed strange behaviour about '<a href="">b_</a>'.
|
||||||
- '0.5': |
|
- '0.5': |
|
||||||
This is an upgrade for ZenCoding.vim: recover rest part in line.
|
This is an upgrade for ZenCoding.vim: recover rest part in line.
|
||||||
- '0.4': |
|
- '0.4': |
|
||||||
|
|||||||
Reference in New Issue
Block a user