diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-03-10 15:25:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 15:25:01 +0300 |
commit | a69c3c408f6e00af9900ab28861af78e38ff1cf4 (patch) | |
tree | b783195def0bbe26ee5245792ec067f710cfd2de /alacritty/src | |
parent | dbccd7e30f40d9a7485c7537b415473ffc09b3d3 (diff) | |
download | r-alacritty-a69c3c408f6e00af9900ab28861af78e38ff1cf4.tar.gz r-alacritty-a69c3c408f6e00af9900ab28861af78e38ff1cf4.tar.bz2 r-alacritty-a69c3c408f6e00af9900ab28861af78e38ff1cf4.zip |
Fix line indicator damage computation
The starting point of damage should be computed from the right side
of the terminal, not from the starting point of line indicator.
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/display/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index 7e8cfc86..1fdc5ac1 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -869,8 +869,9 @@ impl Display { // Damage the maximum possible length of the format text, which could be achieved when // using `MAX_SCROLLBACK_LINES` as current and total lines adding a `3` for formatting. - const MAX_LEN: usize = num_digits(MAX_SCROLLBACK_LINES) + 3; - self.damage_from_point(Point::new(0, point.column - MAX_LEN), MAX_LEN as u32 * 2); + const MAX_SIZE: usize = 2 * num_digits(MAX_SCROLLBACK_LINES) + 3; + let damage_point = Point::new(0, Column(size_info.columns().saturating_sub(MAX_SIZE))); + self.damage_from_point(damage_point, MAX_SIZE as u32); let colors = &config.colors; let fg = colors.line_indicator.foreground.unwrap_or(colors.primary.background); |