From 8a39346b753528091ccd0c933a216db7f27a7321 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Fri, 26 Jun 2020 19:04:55 +0300 Subject: Clear selection on clear line/screen escapes Selection is now cleared if clear line or clear screen escape sequences are clearing content behind it. --- alacritty_terminal/src/grid/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'alacritty_terminal/src/grid/mod.rs') 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 Grid { 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 { + 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(); -- cgit