fix: don't add newline when no value is returned
This commit is contained in:
parent
690cb379d7
commit
9541172174
1 changed files with 3 additions and 1 deletions
|
@ -75,12 +75,14 @@ impl LuaRepl {
|
||||||
CR => {
|
CR => {
|
||||||
match lua.load(&self.buffer).eval::<MultiValue>() {
|
match lua.load(&self.buffer).eval::<MultiValue>() {
|
||||||
Ok(values) => {
|
Ok(values) => {
|
||||||
|
let mut once = false;
|
||||||
for val in values {
|
for val in values {
|
||||||
|
once = true;
|
||||||
self.console.send(
|
self.console.send(
|
||||||
format!("=({}) {}", val.type_name(), pretty_lua(val))
|
format!("=({}) {}", val.type_name(), pretty_lua(val))
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
self.console.send("\n@> ".into())?;
|
self.console.send(format!("{}@> ", if once { "\n" } else { "" }))?;
|
||||||
self.buffer = String::new();
|
self.buffer = String::new();
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
Loading…
Reference in a new issue