summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal/src/grid
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-06-26 19:04:55 +0300
committerGitHub <noreply@github.com>2020-06-26 16:04:55 +0000
commit8a39346b753528091ccd0c933a216db7f27a7321 (patch)
tree82fbbabf69511670c89de9e6702bf9caac730edc /alacritty_terminal/src/grid
parent6c8966f426552065f2846c0c1f555d02aba98141 (diff)
Clear selection on clear line/screen escapes
Selection is now cleared if clear line or clear screen escape sequences are clearing content behind it.
Diffstat (limited to 'alacritty_terminal/src/grid')
-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();