Skip to content

Commit 8411574

Browse files
committed
feat: update anyquotes and anybrackets to behave like mini.ai plugin
1 parent 0919f10 commit 8411574

File tree

2 files changed

+522
-78
lines changed

2 files changed

+522
-78
lines changed

crates/editor/src/display_map.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ impl Sub<u32> for DisplayRow {
13691369
}
13701370

13711371
impl DisplayPoint {
1372+
pub fn offset_plus(&self, map: &DisplaySnapshot, count: usize) -> DisplayPoint {
1373+
let line_len = map.line_len(self.row()) as usize;
1374+
let new_col = (self.column() as usize + count).min(line_len);
1375+
DisplayPoint::new(self.row(), new_col as u32)
1376+
}
1377+
13721378
pub fn new(row: DisplayRow, column: u32) -> Self {
13731379
Self(BlockPoint(Point::new(row.0, column)))
13741380
}

0 commit comments

Comments
 (0)