From c04392b1dc59ed149598b75790abad7734f1cb22 Mon Sep 17 00:00:00 2001 From: Trung Tran Date: Sun, 17 Mar 2024 11:43:08 +0700 Subject: [PATCH] fix: index out of bounds when blaming a file ending with a blank line (#2130) --- src/popups/blame_file.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/popups/blame_file.rs b/src/popups/blame_file.rs index 65c7c2028c..af2fdb90e1 100644 --- a/src/popups/blame_file.rs +++ b/src/popups/blame_file.rs @@ -572,7 +572,8 @@ impl BlameFilePopup { .iter() .map(|l| l.1.clone()) .collect::>(); - let text = tabs_to_spaces(raw_lines.join("\n")); + let mut text = tabs_to_spaces(raw_lines.join("\n")); + text.push('\n'); job.spawn(AsyncSyntaxJob::new( text,