diff --git a/src/emmetHelper.ts b/src/emmetHelper.ts index e36ec3d..099295f 100644 --- a/src/emmetHelper.ts +++ b/src/emmetHelper.ts @@ -292,7 +292,7 @@ function addFinalTabStop(text): string { } // Decide to replace currentTabStop with ${0} only if its the max among all tabstops and is not a placeholder - if (currentTabStop > maxTabStop) { + if (Number(currentTabStop) > Number(maxTabStop)) { maxTabStop = currentTabStop; maxTabStopRanges = [{ numberStart, numberEnd }]; replaceWithLastStop = !foundPlaceholder; diff --git a/src/test/emmetHelperTest.ts b/src/test/emmetHelperTest.ts index 4bc71ab..65301ee 100644 --- a/src/test/emmetHelperTest.ts +++ b/src/test/emmetHelperTest.ts @@ -417,7 +417,10 @@ describe('Test completions', () => { ['
u-l-z
', 0, 10, 'u-l-z', '|', '\${0}'], // Word with - is valid [bemFilterExampleWithInlineFilter, 0, bemFilterExampleWithInlineFilter.length, bemFilterExampleWithInlineFilter, expectedBemFilterOutputDocs, expectedBemFilterOutput], [commentFilterExampleWithInlineFilter, 0, commentFilterExampleWithInlineFilter.length, commentFilterExampleWithInlineFilter, expectedCommentFilterOutputDocs, expectedCommentFilterOutput], - ['li*2+link:css', 0, 13, 'li*2+link:css', '
  • |
  • \n
  • |
  • \n', '
  • \${1}
  • \n
  • \${2}
  • \n'] // No last tab stop gets added as max tab stop is of a placeholder + ['li*2+link:css', 0, 13, 'li*2+link:css', '
  • |
  • \n
  • |
  • \n', '
  • \${1}
  • \n
  • \${2}
  • \n'], // No last tab stop gets added as max tab stop is of a placeholder + ['li*10', 0, 5, 'li*10', '
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • \n
  • |
  • ', + '
  • \${1}
  • \n
  • \${2}
  • \n
  • \${3}
  • \n
  • \${4}
  • \n
  • \${5}
  • \n
  • \${6}
  • \n
  • \${7}
  • \n
  • \${8}
  • \n
  • \${9}
  • \n
  • \${0}
  • '], // tabstop 10 es greater than 9, should be replaced by 0 + ]; testCases.forEach(([content, positionLine, positionChar, expectedAbbr, expectedExpansionDocs, expectedExpansion]) => {