Skip to content

Commit

Permalink
vrepl: fix output of error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jul 4, 2024
1 parent 699e281 commit 8965d23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/tools/vrepl.v
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ fn run_repl(workdir string, vrepl_prefix string) int {
if s.output.len > r.last_output.len {
cur_line_output := s.output[r.last_output.len..]
print_output(cur_line_output)
r.last_output = s.output.clone()
r.lines << r.line
if s.exit_code == 0 {
r.last_output = s.output.clone()
r.lines << r.line
}
}
} else {
mut temp_line := r.line
Expand Down Expand Up @@ -467,8 +469,10 @@ fn run_repl(workdir string, vrepl_prefix string) int {
if s.output.len > r.last_output.len {
cur_line_output := s.output[r.last_output.len..]
print_output(cur_line_output)
r.last_output = s.output.clone()
r.lines << temp_line
if s.exit_code == 0 {
r.last_output = s.output.clone()
r.lines << temp_line
}
}
continue
}
Expand Down

0 comments on commit 8965d23

Please sign in to comment.