reintroduce "? for shortcuts" (#4364)

Reverts openai/codex#4362
This commit is contained in:
Ahmed Ibrahim
2025-09-29 16:35:47 -07:00
committed by GitHub
parent 80ccec6530
commit 98efd352ae
25 changed files with 609 additions and 298 deletions

View File

@@ -10,20 +10,6 @@ const ALT_PREFIX: &str = "⌥";
#[cfg(all(not(test), not(target_os = "macos")))]
const ALT_PREFIX: &str = "Alt+";
#[cfg(test)]
const CTRL_PREFIX: &str = "";
#[cfg(all(not(test), target_os = "macos"))]
const CTRL_PREFIX: &str = "";
#[cfg(all(not(test), not(target_os = "macos")))]
const CTRL_PREFIX: &str = "Ctrl+";
#[cfg(test)]
const SHIFT_PREFIX: &str = "";
#[cfg(all(not(test), target_os = "macos"))]
const SHIFT_PREFIX: &str = "";
#[cfg(all(not(test), not(target_os = "macos")))]
const SHIFT_PREFIX: &str = "Shift+";
fn key_hint_style() -> Style {
Style::default().bold()
}
@@ -32,18 +18,6 @@ fn modifier_span(prefix: &str, key: impl Display) -> Span<'static> {
Span::styled(format!("{prefix}{key}"), key_hint_style())
}
pub(crate) fn ctrl(key: impl Display) -> Span<'static> {
modifier_span(CTRL_PREFIX, key)
}
pub(crate) fn alt(key: impl Display) -> Span<'static> {
modifier_span(ALT_PREFIX, key)
}
pub(crate) fn shift(key: impl Display) -> Span<'static> {
modifier_span(SHIFT_PREFIX, key)
}
pub(crate) fn plain(key: impl Display) -> Span<'static> {
Span::styled(format!("{key}"), key_hint_style())
}