on master help sign in
Avoid trailing `s` in message when only 1 file is opened (#5189)
commit24c3b00d10858a02c6c1c351a7509e204c2bc647 authorNick <sop.theteachr@gmail.com> dateFri 23 Dec 2022, 19:43 (4 years ago) parentb1ca7dd
1 file changed+5−1
helix-term/src/application.rs+5−1
helix-term/src/application.rs+5−1
@@ -227,7 +227,11 @@ impl Application {
227227 doc.set_selection(view_id, pos);
228228 }
229229 }
230− editor.set_status(format!("Loaded {} files.", nr_of_files));
230+ editor.set_status(format!(
231+ "Loaded {} file{}.",
232+ nr_of_files,
233+ if nr_of_files == 1 { "" } else { "s" } // avoid "Loaded 1 files." grammo
234+ ));
231235 // align the view to center after all files are loaded,
232236 // does not affect views without pos since it is at the top
233237 let (view, doc) = current!(editor);