Implement move_line_up and move_line_down
This does not restore folds yet.
This commit is contained in:
@@ -73,7 +73,11 @@ impl Selection {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn buffer_rows_for_display_rows(&self, map: &DisplayMap, ctx: &AppContext) -> Range<u32> {
|
||||
pub fn buffer_rows_for_display_rows(
|
||||
&self,
|
||||
map: &DisplayMap,
|
||||
ctx: &AppContext,
|
||||
) -> (Range<u32>, Range<u32>) {
|
||||
let display_start = self.start.to_display_point(map, ctx).unwrap();
|
||||
let buffer_start = DisplayPoint::new(display_start.row(), 0)
|
||||
.to_buffer_point(map, Bias::Left, ctx)
|
||||
@@ -93,6 +97,9 @@ impl Selection {
|
||||
.to_buffer_point(map, Bias::Left, ctx)
|
||||
.unwrap();
|
||||
|
||||
buffer_start.row..buffer_end.row + 1
|
||||
(
|
||||
buffer_start.row..buffer_end.row + 1,
|
||||
display_start.row()..display_end.row() + 1,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user