Take input text and reset state. Returns None if input is blank.
(&mut self)
| 196 | |
| 197 | /// Take input text and reset state. Returns None if input is blank. |
| 198 | pub fn take_input(&mut self) -> Option<String> { |
| 199 | if self.input.trim().is_empty() { |
| 200 | return None; |
| 201 | } |
| 202 | let text = self.input.clone(); |
| 203 | self.clear(); |
| 204 | Some(text) |
| 205 | } |
| 206 | |
| 207 | pub fn insert_paste(&mut self, text: &str) { |
| 208 | let normalized = text.replace("\r\n", "\n").replace('\r', "\n"); |
no test coverage detected