aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/src/term/search.rs4
-rw-r--r--alacritty_terminal/src/vi_mode.rs2
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 03b69325..27b49b6c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Incorrect window location with negative `window.position` config options
- Slow rendering performance with HiDPI displays, especially on macOS
- Keys swallowed during search when pressing them right before releasing backspace
+- Crash when a wrapped line is rotated into the last line
## 0.5.0
diff --git a/alacritty_terminal/src/term/search.rs b/alacritty_terminal/src/term/search.rs
index a6664054..e9c55f1c 100644
--- a/alacritty_terminal/src/term/search.rs
+++ b/alacritty_terminal/src/term/search.rs
@@ -420,7 +420,9 @@ impl<T> Term<T> {
/// Find the end of the current line across linewraps.
pub fn line_search_right(&self, mut point: Point<usize>) -> Point<usize> {
- while self.grid[point.line][self.cols() - 1].flags.contains(Flags::WRAPLINE) {
+ while point.line > 0
+ && self.grid[point.line][self.cols() - 1].flags.contains(Flags::WRAPLINE)
+ {
point.line -= 1;
}
diff --git a/alacritty_terminal/src/vi_mode.rs b/alacritty_terminal/src/vi_mode.rs
index 985d5455..20b132dd 100644
--- a/alacritty_terminal/src/vi_mode.rs
+++ b/alacritty_terminal/src/vi_mode.rs
@@ -381,7 +381,7 @@ fn is_space<T>(term: &Term<T>, point: Point<usize>) -> bool {
}
fn is_wrap<T>(term: &Term<T>, point: Point<usize>) -> bool {
- term.grid()[point.line][point.col].flags.contains(Flags::WRAPLINE)
+ point.line != 0 && term.grid()[point.line][point.col].flags.contains(Flags::WRAPLINE)
}
/// Check if point is at screen boundary.