Skip to content

Commit 14f8f82

Browse files
committed
Fix infinite loop with unbalanced calc expressions
Found while investigating the problem further… 🤦‍♂️
1 parent 59b34d2 commit 14f8f82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tailwindcss-language-service/src/util/rewriting/replacements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function replaceCssCalc(str: string, replace: CssCalcReplacer): string {
121121

122122
let depth = 0
123123

124-
for (let j = i + 5; i < str.length; ++j) {
124+
for (let j = i + 5; j < str.length; ++j) {
125125
if (str[j] === '(') {
126126
depth++
127127
} else if (str[j] === ')' && depth > 0) {

0 commit comments

Comments
 (0)