Avoid trailing `s` in message when only 1 file is opened (#5189)

pull/5276/head
Nick 2 years ago committed by GitHub
parent b1ca7ddf89
commit 24c3b00d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -227,7 +227,11 @@ impl Application {
doc.set_selection(view_id, pos); 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, // align the view to center after all files are loaded,
// does not affect views without pos since it is at the top // does not affect views without pos since it is at the top
let (view, doc) = current!(editor); let (view, doc) = current!(editor);

Loading…
Cancel
Save