mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
repl: dont save line if last compilation errored
This commit is contained in:
parent
f654c4af7a
commit
aae063b9ad
@ -1375,7 +1375,9 @@ fn run_repl() []string {
|
||||
s := os.exec('$vexe run $temp_file -repl') or {
|
||||
panic(err)
|
||||
}
|
||||
lines << line
|
||||
if !s.exit_code {
|
||||
lines << line
|
||||
}
|
||||
vals := s.output.split('\n')
|
||||
for i:=0; i<vals.len; i++ {
|
||||
println(vals[i])
|
||||
|
5
compiler/tests/repl/error_nosave.repl
Normal file
5
compiler/tests/repl/error_nosave.repl
Normal file
@ -0,0 +1,5 @@
|
||||
a
|
||||
33
|
||||
===output===
|
||||
.vrepl_temp.v:2 undefined: `a`
|
||||
33
|
Loading…
Reference in New Issue
Block a user