fix: output position to col 0

This commit is contained in:
GreasrySlug 2023-02-02 13:56:52 +09:00
parent 858203ae8d
commit abff062d90

View file

@ -77,11 +77,8 @@ impl StdinReader {
execute!(output, SetCursorStyle::BlinkingBar).unwrap();
let mut line = String::new();
self.input(&mut line).unwrap();
if line.is_empty() {
return "".to_string();
}
disable_raw_mode().unwrap();
execute!(output, SetCursorStyle::DefaultUserShape).unwrap();
execute!(output, MoveToColumn(0), SetCursorStyle::DefaultUserShape).unwrap();
self.lineno += 1;
self.buf.push(line);
self.buf.last().cloned().unwrap_or_default()