Method
toggle_wrap_lines
(&mut self, window: &mut Window, cx: &mut Context<Self>)
Source from the content-addressed store, hash-verified
| 198 | fn virtual_text_rows(content: &str) -> Vec<VirtualTextRow> { |
| 199 | if content.is_empty() { |
| 200 | return vec![VirtualTextRow { |
| 201 | line_number: 1, |
| 202 | continuation: false, |
| 203 | byte_range: 0..0, |
| 204 | }]; |
| 205 | } |
| 206 | |
| 207 | let mut rows = Vec::new(); |
| 208 | let mut line_number = 1; |
| 209 | let mut line_start = 0; |
| 210 | |
| 211 | while line_start < content.len() { |
| 212 | let line_end_with_newline = content[line_start..] |
| 213 | .find('\n') |
| 214 | .map(|offset| line_start + offset + 1) |
| 215 | .unwrap_or(content.len()); |
| 216 | let mut line_end = line_end_with_newline; |
Tested by
no test coverage detected