fix(keybindings): stop the menu ellipsis trailing off inside a sentence

Rebinding a chord that another action holds prints "{action} took the
shortcut from {previous}, which is now unset." Both names come off the
keybindings page, where a command that opens something carries a "…" —
so the note read "Rename Tab… took the shortcut from Close Pane / Tab",
and the marker that means "this opens a dialog" turned into a sentence
losing its nerve.

The ellipsis is a menu convention, not punctuation, so it comes off when
the name is interpolated into prose. The rows themselves keep it.
This commit is contained in:
l0ng-ai
2026-08-09 00:17:17 +07:00
parent 40698ed344
commit 94fd075080
+12 -2
View File
@@ -5107,12 +5107,22 @@ impl Tty7App {
.chain(crate::ui::keymap::extra_bindings(cx))
.find(|(a, k)| *k == spec && *a != action)
.map(|(a, _)| a);
// A trailing "…" on an action name marks a command that opens
// something; it is not punctuation, and inside a sentence it reads as
// the sentence trailing off — "Rename Tab… took the shortcut from".
let in_prose = |name: &str| name.trim_end_matches('…').to_string();
let note = displaced.as_ref().map(|other| {
t_fmt(
L10nKey::AppKeybindingDisplacedNote,
&[
("action", &crate::ui::keymap::action_entry(&action).1),
("previous", &crate::ui::keymap::action_entry(other).1),
(
"action",
&in_prose(&crate::ui::keymap::action_entry(&action).1),
),
(
"previous",
&in_prose(&crate::ui::keymap::action_entry(other).1),
),
],
)
});