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

pull/1/head
Nick 1 year 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);
}
}
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);

Loading…
Cancel
Save