mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
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:
+12
-2
@@ -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),
|
||||
),
|
||||
],
|
||||
)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user