From f8334bc959e523be49fcbe8087c44ff120ba4b34 Mon Sep 17 00:00:00 2001 From: gedi Date: Fri, 10 Feb 2017 21:40:39 +0200 Subject: [PATCH] closes #65 --- fmt_pretty.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fmt_pretty.go b/fmt_pretty.go index 153ab5a..05cb41d 100644 --- a/fmt_pretty.go +++ b/fmt_pretty.go @@ -220,6 +220,9 @@ func (f *pretty) printStep(step *gherkin.Step, def *StepDef, c colors.ColorFunc) if m := def.Expr.FindStringSubmatchIndex(step.Text)[2:]; len(m) > 0 { var pos, i int for pos, i = 0, 0; i < len(m); i++ { + if m[i] == -1 { + continue // no index for this match + } if math.Mod(float64(i), 2) == 0 { text += c(step.Text[pos:m[i]]) } else {