Support double_width chars
This commit is contained in:
@@ -108,6 +108,24 @@ impl ModelRect {
|
||||
if right < self.right + len_since_right {
|
||||
right = self.right + len_since_right;
|
||||
}
|
||||
|
||||
// extend also double_width chars
|
||||
let cell = &line.line[self.left];
|
||||
if self.left > 0 && cell.attrs.double_width {
|
||||
let dw_char_idx = self.left - 1;
|
||||
if dw_char_idx < left {
|
||||
left = dw_char_idx;
|
||||
}
|
||||
}
|
||||
|
||||
let dw_char_idx = self.right + 1;
|
||||
if let Some(cell) = line.line.get(dw_char_idx) {
|
||||
if cell.attrs.double_width {
|
||||
if right < dw_char_idx {
|
||||
right = dw_char_idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.left = left;
|
||||
|
||||
Reference in New Issue
Block a user