summaryrefslogtreecommitdiffstats
path: root/resources/resource_transformers/tocss/dartsass/transform.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources/resource_transformers/tocss/dartsass/transform.go')
-rw-r--r--resources/resource_transformers/tocss/dartsass/transform.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/resource_transformers/tocss/dartsass/transform.go b/resources/resource_transformers/tocss/dartsass/transform.go
index 082e30710..be4367b2f 100644
--- a/resources/resource_transformers/tocss/dartsass/transform.go
+++ b/resources/resource_transformers/tocss/dartsass/transform.go
@@ -116,8 +116,13 @@ func (t *transform) Transform(ctx *resources.ResourceTransformationCtx) error {
filename = filename[len(stdinPrefix):]
}
- offsetMatcher := func(m herrors.LineMatcher) bool {
- return m.Offset+len(m.Line) >= start.Offset && strings.Contains(m.Line, context)
+ offsetMatcher := func(m herrors.LineMatcher) int {
+ if m.Offset+len(m.Line) >= start.Offset && strings.Contains(m.Line, context) {
+ // We found the line, but return 0 to signal that we want to determine
+ // the column from the error.
+ return 0
+ }
+ return -1
}
return herrors.NewFileErrorFromFile(sassErr, filename, filename, hugofs.Os, offsetMatcher)