Introduce DisplayRow, MultiBufferRow newtypes and BufferRow type alias (#11656)
Part of https://github.com/zed-industries/zed/issues/8081 To avoid confusion and bugs when converting between various row `u32`'s, use different types for each. Further PRs should split `Point` into buffer and multi buffer variants and make the code more readable. Release Notes: - N/A --------- Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
parent
38f110852f
commit
df41435d1a
46 changed files with 1726 additions and 1220 deletions
|
@ -2,6 +2,7 @@ use std::cmp;
|
|||
|
||||
use editor::{
|
||||
display_map::ToDisplayPoint, movement, scroll::Autoscroll, ClipboardSelection, DisplayPoint,
|
||||
RowExt,
|
||||
};
|
||||
use gpui::{impl_actions, AppContext, ViewContext};
|
||||
use language::{Bias, SelectionGoal};
|
||||
|
@ -99,13 +100,13 @@ fn paste(_: &mut Workspace, action: &Paste, cx: &mut ViewContext<Workspace>) {
|
|||
.map(|selection| cmp::min(selection.start.column(), selection.end.column()))
|
||||
.min()
|
||||
.unwrap();
|
||||
let mut row = current_selections.last().unwrap().end.row() + 1;
|
||||
let mut row = current_selections.last().unwrap().end.row().next_row();
|
||||
while i < clipboard_selections.len() {
|
||||
let cursor =
|
||||
display_map.clip_point(DisplayPoint::new(row, left), Bias::Left);
|
||||
selections_to_process.push((cursor..cursor, false));
|
||||
i += 1;
|
||||
row += 1;
|
||||
row.0 += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue