aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/grid/mod.rs')
-rw-r--r--alacritty_terminal/src/grid/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/alacritty_terminal/src/grid/mod.rs b/alacritty_terminal/src/grid/mod.rs
index 5178ed99..fd555d1b 100644
--- a/alacritty_terminal/src/grid/mod.rs
+++ b/alacritty_terminal/src/grid/mod.rs
@@ -187,6 +187,11 @@ impl<T: GridCell + Default + PartialEq + Copy> Grid<T> {
Point { line: self.lines.0 + self.display_offset - point.line.0 - 1, col: point.col }
}
+ /// Return the cursor position in buffer coordinates.
+ pub fn cursor_buffer_point(&self) -> Point<usize> {
+ Point { line: self.lines.0 - self.cursor.point.line.0 - 1, col: self.cursor.point.col }
+ }
+
/// Update the size of the scrollback history.
pub fn update_history(&mut self, history_size: usize) {
let current_history_size = self.history_size();