Fix underline rendering

This commit is contained in:
daa
2017-09-12 15:09:17 +03:00
parent 61fdb83427
commit 39db875b6f
4 changed files with 10 additions and 20 deletions

View File

@@ -158,10 +158,6 @@ impl Line {
self.item_line[start_cell] = Some(Item::new(new_item.clone(), end_cell - start_cell + 1));
}
pub fn mark_dirty_cell(&mut self, idx: usize) {
self.line[idx].dirty = true;
}
pub fn get_item_mut(&mut self, cell_idx: usize) -> Option<&mut Item> {
let item_idx = self.cell_to_item(cell_idx);
if item_idx >= 0 {

View File

@@ -74,13 +74,13 @@ impl UiModel {
let mut changed_region = self.cur_point();
let line = &mut self.model[self.cur_row];
line.dirty_line = true;
line.mark_dirty_cell(self.cur_col);
let cell = &mut line[self.cur_col];
cell.ch = text.chars().last().unwrap_or(' ');
cell.attrs = attrs.map(Attrs::clone).unwrap_or_else(Attrs::new);
cell.attrs.double_width = text.is_empty();
cell.dirty = true;
self.cur_col += 1;
if self.cur_col >= self.columns {
self.cur_col -= 1;