aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bulimov <lazywolf0@gmail.com>2019-01-21 21:59:10 +0000
committerChristian Duerr <chrisduerr@users.noreply.github.com>2019-01-21 21:59:10 +0000
commitc3bac1c453a7ae7c08ee3e8b4d9c2327464d148f (patch)
treebf56bec26c9358ea6bb890740015f86747d7c1e8
parentd62fe71b6071a9cc1b520c0e87c96111a719327a (diff)
downloadalacritty-c3bac1c453a7ae7c08ee3e8b4d9c2327464d148f.tar.gz
alacritty-c3bac1c453a7ae7c08ee3e8b4d9c2327464d148f.zip
Fix off-by-one error in erase_chars
-rw-r--r--CHANGELOG.md6
-rw-r--r--src/term/mod.rs2
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ca7532c..9b2dde91 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Fixed
+
+- Resolved off-by-one issue with erasing characters in the last column
+
## Version 0.2.7
### Fixed
diff --git a/src/term/mod.rs b/src/term/mod.rs
index c435d501..487ba20d 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -1702,7 +1702,7 @@ impl ansi::Handler for Term {
fn erase_chars(&mut self, count: Column) {
trace!("Erasing chars: count={}, col={}", count, self.cursor.point.col);
let start = self.cursor.point.col;
- let end = min(start + count, self.grid.num_cols() - 1);
+ let end = min(start + count, self.grid.num_cols());
let row = &mut self.grid[self.cursor.point.line];
let template = self.cursor.template; // Cleared cells have current background color set