Only pluralise "buffer" when required (#11018)
* Only pluralise buffer when required * Use == 1 instead of != 1
This commit is contained in:
parent
b05ed9bf85
commit
6ed0d0cd39
1 changed files with 6 additions and 4 deletions
|
@ -164,9 +164,10 @@ fn buffer_close_by_ids_impl(
|
||||||
cx.editor.switch(*first, Action::Replace);
|
cx.editor.switch(*first, Action::Replace);
|
||||||
}
|
}
|
||||||
bail!(
|
bail!(
|
||||||
"{} unsaved buffer(s) remaining: {:?}",
|
"{} unsaved buffer{} remaining: {:?}",
|
||||||
modified_names.len(),
|
modified_names.len(),
|
||||||
modified_names
|
if modified_names.len() == 1 { "" } else { "s" },
|
||||||
|
modified_names,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -658,9 +659,10 @@ pub(super) fn buffers_remaining_impl(editor: &mut Editor) -> anyhow::Result<()>
|
||||||
editor.switch(*first, Action::Replace);
|
editor.switch(*first, Action::Replace);
|
||||||
}
|
}
|
||||||
bail!(
|
bail!(
|
||||||
"{} unsaved buffer(s) remaining: {:?}",
|
"{} unsaved buffer{} remaining: {:?}",
|
||||||
modified_names.len(),
|
modified_names.len(),
|
||||||
modified_names
|
if modified_names.len() == 1 { "" } else { "s" },
|
||||||
|
modified_names,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Reference in a new issue