Implement move_line_up and move_line_down
This does not restore folds yet.
This commit is contained in:
@@ -169,6 +169,13 @@ impl FoldMap {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn to_buffer_offset(&self, point: DisplayPoint, app: &AppContext) -> Result<usize> {
|
||||
let mut cursor = self.transforms.cursor::<DisplayPoint, TransformSummary>();
|
||||
cursor.seek(&point, SeekBias::Right);
|
||||
let overshoot = point.0 - cursor.start().display.lines;
|
||||
(cursor.start().buffer.lines + overshoot).to_offset(self.buffer.read(app))
|
||||
}
|
||||
|
||||
pub fn to_display_offset(
|
||||
&self,
|
||||
point: DisplayPoint,
|
||||
|
||||
Reference in New Issue
Block a user