aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick2022-12-23 14:13:05 +0000
committerGitHub2022-12-23 14:13:05 +0000
commit24c3b00d10858a02c6c1c351a7509e204c2bc647 (patch)
tree37dc0a480e647b05b3c0011e7d6db4a3f4921fcb
parentb1ca7ddf89c048a8da0d6cfe507ac3344e6f625f (diff)
Avoid trailing `s` in message when only 1 file is opened (#5189)
-rw-r--r--helix-term/src/application.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 7a50e007..5f013b9a 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -227,7 +227,11 @@ impl Application {
doc.set_selection(view_id, pos);
}
}
- editor.set_status(format!("Loaded {} files.", nr_of_files));
+ editor.set_status(format!(
+ "Loaded {} file{}.",
+ nr_of_files,
+ if nr_of_files == 1 { "" } else { "s" } // avoid "Loaded 1 files." grammo
+ ));
// align the view to center after all files are loaded,
// does not affect views without pos since it is at the top
let (view, doc) = current!(editor);