Handles a carriage return key press.
(&mut self)
| 155 | |
| 156 | /// Handles a carriage return key press. |
| 157 | fn do_carriage_return(&mut self) -> io::Result<DispatchResult> { |
| 158 | // TODO(jmmv): This is here because the integration tests may be checked out with |
| 159 | // CRLF line endings on Windows, which means we'd see two characters to end a line |
| 160 | // instead of one. Not sure if we should do this or if instead we should ensure |
| 161 | // the golden data we feed to the tests has single-character line endings. |
| 162 | if cfg!(not(target_os = "windows")) { |
| 163 | self.console.print("")?; |
| 164 | Ok(DispatchResult::Submit) |
| 165 | } else { |
| 166 | Ok(DispatchResult::Continue) |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | /// Handles a regular character insertion. |
| 171 | fn do_char(&mut self, ch: char) -> io::Result<DispatchResult> { |