diff options
author | Aram Drevekenin <aram@poor.dev> | 2021-05-28 17:30:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 17:30:23 +0200 |
commit | 12709e3e48ec174c9ddab9ee3f5a44ed561ccba2 (patch) | |
tree | a4459f2a0460db64810319c80c0cd8c9c3a1c9fd | |
parent | 774858f240d709386967d13568817a821b028a60 (diff) |
fix(compatibility): do not crash when padding before wide char (#540)
* fix(compatibility): do not crash when padding before wide char
* style(clippy): make less clear because clippy
-rw-r--r-- | zellij-server/src/panes/grid.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 14bdbcd16..8eda2a51e 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1769,6 +1769,8 @@ impl Row { let mut replace_with = vec![terminal_character; to + width_of_current_character]; if to_position_accounting_for_widechars > self.columns.len() { self.columns.clear(); + } else if to_position_accounting_for_widechars >= self.columns.len() { + drop(self.columns.drain(0..to_position_accounting_for_widechars)); } else { drop(self.columns.drain(0..=to_position_accounting_for_widechars)); } |