vim: Fix paragraphs with softwrap (#20259)
Closes #19778 Release Notes: - vim: Fixed paragraph object in the presence of softwrap
This commit is contained in:
parent
4bf6fb217e
commit
86ff6e2c8e
2 changed files with 20 additions and 4 deletions
|
@ -1172,7 +1172,7 @@ impl Sub for DisplayPoint {
|
|||
#[serde(transparent)]
|
||||
pub struct DisplayRow(pub u32);
|
||||
|
||||
impl Add for DisplayRow {
|
||||
impl Add<DisplayRow> for DisplayRow {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, other: Self) -> Self::Output {
|
||||
|
@ -1180,7 +1180,15 @@ impl Add for DisplayRow {
|
|||
}
|
||||
}
|
||||
|
||||
impl Sub for DisplayRow {
|
||||
impl Add<u32> for DisplayRow {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, other: u32) -> Self::Output {
|
||||
DisplayRow(self.0 + other)
|
||||
}
|
||||
}
|
||||
|
||||
impl Sub<DisplayRow> for DisplayRow {
|
||||
type Output = Self;
|
||||
|
||||
fn sub(self, other: Self) -> Self::Output {
|
||||
|
@ -1188,6 +1196,14 @@ impl Sub for DisplayRow {
|
|||
}
|
||||
}
|
||||
|
||||
impl Sub<u32> for DisplayRow {
|
||||
type Output = Self;
|
||||
|
||||
fn sub(self, other: u32) -> Self::Output {
|
||||
DisplayRow(self.0 - other)
|
||||
}
|
||||
}
|
||||
|
||||
impl DisplayPoint {
|
||||
pub fn new(row: DisplayRow, column: u32) -> Self {
|
||||
Self(BlockPoint(Point::new(row.0, column)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue