diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index ade2374616..3306988d34 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -941,12 +941,12 @@ fn missing_compiler_info() string { fn error_context_lines(text string, keyword string, before int, after int) []string { khighlight := if term.can_show_color_on_stdout() { term.red(keyword) } else { keyword } - mut eline_idx := 0 + mut eline_idx := -1 mut lines := text.split_into_lines() for idx, eline in lines { if eline.contains(keyword) { lines[idx] = lines[idx].replace(keyword, khighlight) - if eline_idx == 0 { + if eline_idx == -1 { eline_idx = idx } }