Fix numbering on nested multiplication

If an element is being multiplied, its number should reflect the repeating of that element, not the group it belongs in.

----
Example case:

Input: .outer$*3>.inner$*2

Expected output:
<div class="outer1">
  <!-- two DIVs: .inner1, .inner2 -->
</div>
<div class="outer2">
  <!-- two DIVs: .inner1, .inner2 -->
</div>
<div class="outer3">
  <!-- two DIVs: .inner1, .inner2 -->
</div>

Observed output:
<div class="outer1">
  <!-- two DIVs: .inner1, .inner2 -->
</div>
<div class="outer2">
  <!-- two DIVs: .inner2, .inner2 -->
</div>
<div class="outer3">
  <!-- two DIVs: .inner3, .inner3 -->
</div>
This commit is contained in:
Mike Wadsten
2013-08-09 22:45:42 -05:00
committed by mattn
parent cb869edec4
commit 2a5684bac4

View File

@@ -169,7 +169,7 @@ function! emmet#toString(...)
let rtype = emmet#lang#exists(type) ? type : 'html'
while itemno < current.multiplier
if len(current.name)
if group_itemno != 0
if current.multiplier == 1
let inner = emmet#lang#{rtype}#toString(s:emmet_settings, current, type, inline, filters, group_itemno, indent)
else
let inner = emmet#lang#{rtype}#toString(s:emmet_settings, current, type, inline, filters, itemno, indent)