Handle printable keys
(&mut self, c: char)
| 354 | |
| 355 | // Handle printable keys |
| 356 | fn handle_printable(&mut self, c: char) |
| 357 | { |
| 358 | self.compupdate(); |
| 359 | self.histupdate(); |
| 360 | if crate::sys::console::canprint(c) |
| 361 | { |
| 362 | let i = self.cur - self.offset; |
| 363 | self.ln.insert(i, c); |
| 364 | |
| 365 | // Use UTF-32 |
| 366 | let s = &self.ln[i..]; |
| 367 | let n = s.len(); |
| 368 | |
| 369 | // Use UTF-8 |
| 370 | let s: String = s.iter().collect(); |
| 371 | print!("{} \x1b[{}D", s, n); |
| 372 | self.cur += 1; |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | |
| 377 | // Handle tab key |
no test coverage detected