Skip to content

Commit feadf77

Browse files
committed
builder: fix a bug in error_context_lines
1 parent 00a0c18 commit feadf77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vlib/v/builder/cc.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,12 +941,12 @@ fn missing_compiler_info() string {
941941

942942
fn error_context_lines(text string, keyword string, before int, after int) []string {
943943
khighlight := if term.can_show_color_on_stdout() { term.red(keyword) } else { keyword }
944-
mut eline_idx := 0
944+
mut eline_idx := -1
945945
mut lines := text.split_into_lines()
946946
for idx, eline in lines {
947947
if eline.contains(keyword) {
948948
lines[idx] = lines[idx].replace(keyword, khighlight)
949-
if eline_idx == 0 {
949+
if eline_idx == -1 {
950950
eline_idx = idx
951951
}
952952
}

0 commit comments

Comments
 (0)