Offset from prompt
(s: &str)
| 534 | |
| 535 | // Offset from prompt |
| 536 | fn offset_from_prompt(s: &str) -> usize |
| 537 | { |
| 538 | let mut parser = Parser::new(); |
| 539 | let mut offset = Offset(0); |
| 540 | |
| 541 | for b in s.bytes() |
| 542 | { |
| 543 | parser.advance(&mut offset, b); |
| 544 | } |
| 545 | |
| 546 | offset.0 |
| 547 | } |
| 548 | |
| 549 | |
| 550 | // Empty completer function |