(
mut o: impl Write + 'b,
state: &'b mut ParseState,
)
| 190 | } |
| 191 | |
| 192 | fn text<'a, 'b>( |
| 193 | mut o: impl Write + 'b, |
| 194 | state: &'b mut ParseState, |
| 195 | ) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b { |
| 196 | move |i| { |
| 197 | let content = take_while(1.., |t| AsChar::is_alphanum(t) || "+,.!?\"".contains(t)).parse_next(i)?; |
| 198 | if state.is_first_line { |
| 199 | state.is_first_line = false; |
| 200 | // The extra space here is reserved for the prompt pointer ("> "). |
| 201 | // Essentially we want the input to wrap as if the prompt pointer is a part of it |
| 202 | // but only display what is received. |
| 203 | queue_newline_or_advance(&mut o, state, content.width() + 2)?; |
| 204 | } else { |
| 205 | queue_newline_or_advance(&mut o, state, content.width())?; |
| 206 | } |
| 207 | queue(&mut o, style::Print(content))?; |
| 208 | |
| 209 | Ok(()) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | fn heading<'a, 'b>( |
| 214 | mut o: impl Write + 'b, |
nothing calls this directly
no test coverage detected