summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-11-15 03:28:03 +0300
committerGitHub <noreply@github.com>2020-11-15 00:28:03 +0000
commit2a16cc5155fc11bfa965c632c6c1d3a257b3f59a (patch)
treeebe31d339ac595ea7628632b5d7ee5bcb2bcea2a /alacritty_terminal/src
parent198d3cb78d9f9432e1d829f44aec46ec7971c24d (diff)
downloadalacritty-2a16cc5155fc11bfa965c632c6c1d3a257b3f59a.tar.gz
alacritty-2a16cc5155fc11bfa965c632c6c1d3a257b3f59a.zip
Fix zerowidth characters in the last column
This commit fixes the issue that when attempting to write zerowidth characters into the last column, it is written in the second to last column instead. Fixes #4227. Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r--alacritty_terminal/src/term/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index 6e20f0e1..cdcfad9d 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -1480,11 +1480,18 @@ impl<T: EventListener> Handler for Term<T> {
// Handle zero-width characters.
if width == 0 {
- let mut col = self.grid.cursor.point.col.0.saturating_sub(1);
+ // Get previous column.
+ let mut col = self.grid.cursor.point.col.0;
+ if !self.grid.cursor.input_needs_wrap {
+ col = col.saturating_sub(1);
+ }
+
+ // Put zerowidth characters over first fullwidth character cell.
let line = self.grid.cursor.point.line;
if self.grid[line][Column(col)].flags.contains(Flags::WIDE_CHAR_SPACER) {
col = col.saturating_sub(1);
}
+
self.grid[line][Column(col)].push_zerowidth(c);
return;
}