Implement BlockSnapshot::line_len, use it in DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
00b5cc472e
commit
707ffe8ff3
4 changed files with 41 additions and 15 deletions
|
@ -249,6 +249,11 @@ impl Rope {
|
|||
self.summary().lines_utf16
|
||||
}
|
||||
}
|
||||
|
||||
pub fn line_len(&self, row: u32) -> u32 {
|
||||
self.clip_point(Point::new(row, u32::MAX), Bias::Left)
|
||||
.column
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for Rope {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue