From bf287516ed5eccd0ae2867b0813ae57ffa11fef7 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 4 Aug 2023 12:26:02 -0700 Subject: [PATCH] Fixed printing on enter --- src/entry/unix/unix.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/entry/unix/unix.rs b/src/entry/unix/unix.rs index 677b666..9ba9d03 100644 --- a/src/entry/unix/unix.rs +++ b/src/entry/unix/unix.rs @@ -188,6 +188,9 @@ pub fn main() -> Result<(), std::io::Error> { if let Key::Char(q) = c.as_ref().unwrap() { match q { '\n' => { + // Print again without cursor, in case we pressed enter + // while inside a substitution + pb.write_prompt_nocursor(&mut stdout)?; let in_str = pb.enter(); write!(stdout, "\r\n")?; if in_str == "" { break; }