Skip to content

Commit

Permalink
feat: update anyquotes and anybrackets to behave like mini.ai plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
oca159 committed Feb 4, 2025
1 parent 0919f10 commit 8411574
Show file tree
Hide file tree
Showing 2 changed files with 522 additions and 78 deletions.
6 changes: 6 additions & 0 deletions crates/editor/src/display_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,12 @@ impl Sub<u32> for DisplayRow {
}

impl DisplayPoint {
pub fn offset_plus(&self, map: &DisplaySnapshot, count: usize) -> DisplayPoint {
let line_len = map.line_len(self.row()) as usize;
let new_col = (self.column() as usize + count).min(line_len);
DisplayPoint::new(self.row(), new_col as u32)
}

pub fn new(row: DisplayRow, column: u32) -> Self {
Self(BlockPoint(Point::new(row.0, column)))
}
Expand Down
Loading

0 comments on commit 8411574

Please sign in to comment.