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