Implement BlockSnapshot::line_len, use it in DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
00b5cc472e
commit
707ffe8ff3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user