Update placeholder text with key bindings to focus context panel and navigate history (#19447)

Hopefully, this will help people understand how easy it is to add
context to an inline transformation.

![CleanShot 2024-10-18 at 22 41
00@2x](https://github.com/user-attachments/assets/c09c1d89-3df2-4079-9849-9de7ac63c003)

@as-cii @maxdeviant @rtfeldman could somebody update this to display the
actual correct key bindings and ship it. I have them hard coded for now.

Release Notes:

- Updated placeholder text with key bindings to focus context panel and
navigate history.

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
Nathan Sobo
2024-10-25 14:09:21 -04:00
committed by GitHub
co-authored by Richard Feldman
parent 85bdd9329b
commit 24cb694494
3 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ impl KeyIcon {
}
/// Returns a textual representation of the key binding for the given [`Action`].
pub fn text_for_action(action: &dyn Action, cx: &mut WindowContext) -> Option<String> {
pub fn text_for_action(action: &dyn Action, cx: &WindowContext) -> Option<String> {
let key_binding = cx.bindings_for_action(action).last().cloned()?;
Some(text_for_key_binding(key_binding, PlatformStyle::platform()))
}