The 1-based line and the UTF-16 column of `offset`.
(src: &str, line_starts: &[usize], offset: usize)
| 86 | |
| 87 | /// The 1-based line and the UTF-16 column of `offset`. |
| 88 | pub fn position_of(src: &str, line_starts: &[usize], offset: usize) -> (u32, u32) { |
| 89 | let row = line_starts.partition_point(|&s| s <= offset).saturating_sub(1); |
| 90 | (row as u32 + 1, util::col16(src, line_starts, row, offset)) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | fn is_blank(c: u8) -> bool { |