Use group_itemno or itemno that greating. close #118

This commit is contained in:
mattn
2013-04-23 09:46:04 +09:00
parent 25aeb9d1c3
commit bc262ed52b

View File

@@ -1,7 +1,7 @@
"=============================================================================
" zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 09-Apr-2013.
" Last Change: 23-Apr-2013.
let s:save_cpo = &cpo
set cpo&vim
@@ -198,7 +198,7 @@ function! zencoding#toString(...)
if len(current.value)
let text = current.value[1:-2]
if dollar_expr
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", max([itemno, group_itemno])+1).submatch(2)', 'g')
let text = substitute(text, '\${nr}', "\n", 'g')
let text = substitute(text, '\\\$', '$', 'g')
endif