Fixed printing on enter

pull/2/head
Mark 2023-08-04 12:26:02 -07:00
parent d452f76455
commit bf287516ed
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 3 additions and 0 deletions

View File

@ -188,6 +188,9 @@ pub fn main() -> Result<(), std::io::Error> {
if let Key::Char(q) = c.as_ref().unwrap() { if let Key::Char(q) = c.as_ref().unwrap() {
match q { match q {
'\n' => { '\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(); let in_str = pb.enter();
write!(stdout, "\r\n")?; write!(stdout, "\r\n")?;
if in_str == "" { break; } if in_str == "" { break; }