Skip to content

Commit

Permalink
swap ops
Browse files Browse the repository at this point in the history
  • Loading branch information
dfrg committed Aug 15, 2024
1 parent 60b99d1 commit 54d08a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parley/src/layout/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Cursor {
///
/// Returns `None` if the cursor should remain in its current position.
pub fn next_line<B: Brush>(&self, layout: &Layout<B>, h_pos: Option<f32>) -> Option<Cursor> {
move_to_line(layout, self, h_pos, self.path.line_index.checked_sub(1)?)
move_to_line(layout, self, h_pos, self.path.line_index.checked_add(1)?)
}

/// Given the layout that generated this cursor, return a new cursor
Expand All @@ -175,7 +175,7 @@ impl Cursor {
///
/// Returns `None` if the cursor should remain in its current position.
pub fn prev_line<B: Brush>(&self, layout: &Layout<B>, h_pos: Option<f32>) -> Option<Cursor> {
move_to_line(layout, self, h_pos, self.path.line_index.checked_add(1)?)
move_to_line(layout, self, h_pos, self.path.line_index.checked_sub(1)?)
}
}

Expand Down

0 comments on commit 54d08a0

Please sign in to comment.