From 2df8f860b960d7c96efaf4f059fe2fbbdce82bcc Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 25 Mar 2023 00:07:20 +0100 Subject: Fix selection rotation on the last line This fixes an issue with terminal resizes when the selection is on the last line. Alacritty would fail to rotate lines and keep the selection in the same line index whenever the terminal line count was grown or shrunk. This issue occurred due to the range passed to the selection's rotate function still being based on the old terminal size, which caused the initial or target state of the rotation to be outside of the terminal bounds. Closes #6698. --- alacritty/src/renderer/text/builtin_font.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'alacritty/src/renderer') diff --git a/alacritty/src/renderer/text/builtin_font.rs b/alacritty/src/renderer/text/builtin_font.rs index f2c0e3ea..06eb5bc0 100644 --- a/alacritty/src/renderer/text/builtin_font.rs +++ b/alacritty/src/renderer/text/builtin_font.rs @@ -719,9 +719,8 @@ impl Canvas { let v_line_bounds = (v_line_bounds.0 as usize, v_line_bounds.1 as usize); let max_transparancy = 0.5; - for (radius_y, radius_x) in (h_line_bounds.0..h_line_bounds.1) - .into_iter() - .zip((v_line_bounds.0..v_line_bounds.1).into_iter()) + for (radius_y, radius_x) in + (h_line_bounds.0..h_line_bounds.1).zip(v_line_bounds.0..v_line_bounds.1) { let radius_x = radius_x as f32; let radius_y = radius_y as f32; -- cgit