summaryrefslogtreecommitdiff
path: root/src/watch/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/watch/state.rs')
-rw-r--r--src/watch/state.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 2cf7521..f3ffac8 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -166,14 +166,11 @@ When you are done experimenting, enter `n` (or `next`) to move on to the next ex
self.render()
}
- pub fn handle_invalid_cmd(&mut self, cmd: &str) -> io::Result<()> {
- self.writer.write_all(b"Invalid command: ")?;
- self.writer.write_all(cmd.as_bytes())?;
- if cmd.len() > 1 {
- self.writer
- .write_all(b" (confusing input can occur after resizing the terminal)")?;
- }
- self.writer.write_all(b"\n")?;
+ pub fn handle_invalid_input(&mut self, input: char) -> io::Result<()> {
+ writeln!(
+ self.writer,
+ "Invalid input: {input} (confusing input can occur after resizing the terminal)",
+ )?;
self.show_prompt()
}
}