forked from VimPlug/emmet-vim
fix group item number. close #25
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" zencoding.vim
|
" zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 10-Jun-2012.
|
" Last Change: 11-Jun-2012.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -121,6 +121,11 @@ function! zencoding#toString(...)
|
|||||||
else
|
else
|
||||||
let filters = ['html']
|
let filters = ['html']
|
||||||
endif
|
endif
|
||||||
|
if a:0 > 4
|
||||||
|
let group_itemno = a:5
|
||||||
|
else
|
||||||
|
let group_itemno = 0
|
||||||
|
endif
|
||||||
|
|
||||||
let indent = zencoding#getIndentation(type)
|
let indent = zencoding#getIndentation(type)
|
||||||
let itemno = 0
|
let itemno = 0
|
||||||
@@ -129,7 +134,11 @@ function! zencoding#toString(...)
|
|||||||
let rtype = len(globpath(&rtp, 'autoload/zencoding/lang/'.type.'.vim')) ? type : 'html'
|
let rtype = len(globpath(&rtp, 'autoload/zencoding/lang/'.type.'.vim')) ? type : 'html'
|
||||||
while itemno < current.multiplier
|
while itemno < current.multiplier
|
||||||
if len(current.name)
|
if len(current.name)
|
||||||
|
if group_itemno != 0
|
||||||
|
let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, group_itemno, indent)
|
||||||
|
else
|
||||||
let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent)
|
let inner = zencoding#lang#{rtype}#toString(s:zen_settings, current, type, inline, filters, itemno, indent)
|
||||||
|
endif
|
||||||
if current.multiplier > 1
|
if current.multiplier > 1
|
||||||
let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g')
|
let inner = substitute(inner, '\$#', '$line'.(itemno+1).'$', 'g')
|
||||||
endif
|
endif
|
||||||
@@ -170,7 +179,7 @@ function! zencoding#toString(...)
|
|||||||
let inner = ''
|
let inner = ''
|
||||||
if len(current.child)
|
if len(current.child)
|
||||||
for n in current.child
|
for n in current.child
|
||||||
let inner .= zencoding#toString(n, type, inline, filters)
|
let inner .= zencoding#toString(n, type, inline, filters, group_itemno)
|
||||||
endfor
|
endfor
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ function! zencoding#lang#html#toString(settings, current, type, inline, filters,
|
|||||||
let dr = 1
|
let dr = 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let inner = zencoding#toString(child, type, 0, filters)
|
let inner = zencoding#toString(child, type, 0, filters, itemno)
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||||
let inner = substitute(inner, "\n" . indent . '$', '', 'g')
|
let inner = substitute(inner, "\n" . indent . '$', '', 'g')
|
||||||
let str .= inner
|
let str .= inner
|
||||||
|
|||||||
Reference in New Issue
Block a user