1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-25 14:05:41 -05:00

Fix off-by-one error in erase_chars

This commit is contained in:
Alexander Bulimov 2019-01-21 21:59:10 +00:00 committed by Christian Duerr
parent d62fe71b60
commit c3bac1c453
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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