MCPcopy Index your code
hub / github.com/endbasic/endbasic / do_carriage_return

Method do_carriage_return

std/src/console/readline.rs:157–168  ·  view source on GitHub ↗

Handles a carriage return key press.

(&mut self)

Source from the content-addressed store, hash-verified

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> {

Callers 1

runMethod · 0.80

Calls 1

printMethod · 0.45

Tested by

no test coverage detected