Skip to content

Commit 1976dd0

Browse files
committed
test: added additional test which was breaking
1 parent ab814ae commit 1976dd0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/twmerge/modifier-utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func MakeSplitModifiers(conf *TwMergeConfig) SplitModifiersFn {
4646
baseClass = baseClassWithImportant
4747
}
4848

49+
// fix case where there is modifier & maybePostfix which causes maybePostfix to be beyond size of baseClass
50+
if maybePostfixModPosition != -1 && maybePostfixModPosition > modifierStart {
51+
maybePostfixModPosition -= modifierStart
52+
}
53+
4954
return baseClass, modifiers, hasImportant, maybePostfixModPosition
5055

5156
}

0 commit comments

Comments
 (0)