Treats EOF as delete while text exists, or reports end-of-input otherwise.
(&mut self)
| 238 | |
| 239 | /// Treats EOF as delete while text exists, or reports end-of-input otherwise. |
| 240 | fn do_eof_or_delete(&mut self) -> io::Result<DispatchResult> { |
| 241 | if self.line.is_empty() { |
| 242 | Err(io::Error::new(io::ErrorKind::UnexpectedEof, "EOF")) |
| 243 | } else { |
| 244 | self.do_delete() |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | /// Moves the cursor to the start of the line. |
| 249 | fn do_home(&mut self) -> io::Result<DispatchResult> { |