summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTrung Tran <trandinhtrung176@gmail.com>2024-03-17 11:43:08 +0700
committerextrawurst <776816+extrawurst@users.noreply.github.com>2024-03-20 01:37:59 +0100
commit99b9a38fb3859c6f97a5ce89c0eb096ced5f6e87 (patch)
treee9e9e38602fe231d7bdd854ce22c9b8853582d5d /src
parentbaddec0e3958e44ecef817607f67f603b4813bb4 (diff)
fix: index out of bounds when blaming a file ending with a blank line (#2130)
Diffstat (limited to 'src')
-rw-r--r--src/popups/blame_file.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/popups/blame_file.rs b/src/popups/blame_file.rs
index 65c7c202..af2fdb90 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::<Vec<_>>();
- 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,