From 765d296f16771a076e13940c1c2c96e2fe543f70 Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Thu, 13 Oct 2022 18:56:15 +0200 Subject: [PATCH] =?UTF-8?q?Improve=20the=20repl=20mode=20=F0=9F=A5=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/repl/impl_repl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/repl/impl_repl.rs b/src/repl/impl_repl.rs index f791ee0..88f0f5c 100644 --- a/src/repl/impl_repl.rs +++ b/src/repl/impl_repl.rs @@ -43,7 +43,7 @@ impl Repl { print!( "{}", if self.loop_depth != 0 { - "........ ".yellow() + "............... ".yellow() } else { PROMPT.to_string().truecolor(54, 76, 76) } @@ -85,10 +85,10 @@ impl Repl { self.term.write_str(&c.to_string())?; input.push(c); } - Key::Backspace => { + Key::Backspace if !input.is_empty() => { self.term.clear_line()?; + self.print_prompt(); self.term.write_str(&input[0..input.len() - 1])?; - self.term.move_cursor_left(1)?; input.pop(); } Key::Enter => {