aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/grid.rs14
-rw-r--r--src/screen.rs7
2 files changed, 6 insertions, 15 deletions
diff --git a/src/grid.rs b/src/grid.rs
index de98da1..085e744 100644
--- a/src/grid.rs
+++ b/src/grid.rs
@@ -171,16 +171,6 @@ impl Grid {
.and_then(|r| r.get_mut(pos.col))
}
- pub fn current_cell(&self) -> &crate::cell::Cell {
- self.drawing_cell(self.pos)
- .expect("cursor not pointing to a cell")
- }
-
- pub fn current_cell_mut(&mut self) -> &mut crate::cell::Cell {
- self.drawing_cell_mut(self.pos)
- .expect("cursor not pointing to a cell")
- }
-
pub fn scrollback_len(&self) -> usize {
self.scrollback_len
}
@@ -458,8 +448,8 @@ impl Grid {
pub fn insert_cells(&mut self, count: u16) {
let size = self.size;
let pos = self.pos;
- let wide =
- pos.col < size.cols && self.current_cell().is_wide_continuation();
+ let wide = pos.col < size.cols
+ && self.drawing_cell(pos).unwrap().is_wide_continuation();
let row = self.current_row_mut();
for _ in 0..count {
if wide {
diff --git a/src/screen.rs b/src/screen.rs
index 6c3d629..9e81ee2 100644
--- a/src/screen.rs
+++ b/src/screen.rs
@@ -906,12 +906,12 @@ impl Screen {
next_cell.set(' ', attrs);
}
- let cell = self.grid_mut().current_cell_mut();
+ let cell = self.grid_mut().drawing_cell_mut(pos).unwrap();
cell.set(c, attrs);
self.grid_mut().col_inc(1);
if width > 1 {
let pos = self.grid().pos();
- if self.grid().current_cell().is_wide() {
+ if self.grid().drawing_cell(pos).unwrap().is_wide() {
let next_next_pos = crate::grid::Pos {
row: pos.row,
col: pos.col + 1,
@@ -928,7 +928,8 @@ impl Screen {
.wrap(false);
}
}
- let next_cell = self.grid_mut().current_cell_mut();
+ let next_cell =
+ self.grid_mut().drawing_cell_mut(pos).unwrap();
next_cell.clear(crate::attrs::Attrs::default());
next_cell.set_wide_continuation(true);
self.grid_mut().col_inc(1);