mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
add name
to $env.config.keybindings
(#14159)
# Description This PR adds the `name` column back to keybindings. This may be considered a hack since the reedline keybinding has no spot for name, but it seems to work.
This commit is contained in:
parent
ae54d05930
commit
3a685049da
@ -711,6 +711,7 @@ pub(crate) fn create_keybindings(config: &Config) -> Result<KeybindingsMode, She
|
||||
}
|
||||
for keybinding in parsed_keybindings {
|
||||
add_keybinding(
|
||||
&keybinding.name,
|
||||
&keybinding.mode,
|
||||
keybinding,
|
||||
config,
|
||||
@ -729,7 +730,9 @@ pub(crate) fn create_keybindings(config: &Config) -> Result<KeybindingsMode, She
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::only_used_in_recursion)]
|
||||
fn add_keybinding(
|
||||
name: &Option<Value>,
|
||||
mode: &Value,
|
||||
keybinding: &ParsedKeybinding,
|
||||
config: &Config,
|
||||
@ -752,6 +755,7 @@ fn add_keybinding(
|
||||
Value::List { vals, .. } => {
|
||||
for inner_mode in vals {
|
||||
add_keybinding(
|
||||
name,
|
||||
inner_mode,
|
||||
keybinding,
|
||||
config,
|
||||
|
@ -5,6 +5,7 @@ use crate::{engine::Closure, FromValue};
|
||||
/// Definition of a parsed keybinding from the config object
|
||||
#[derive(Clone, Debug, FromValue, IntoValue, Serialize, Deserialize)]
|
||||
pub struct ParsedKeybinding {
|
||||
pub name: Option<Value>,
|
||||
pub modifier: Value,
|
||||
pub keycode: Value,
|
||||
pub event: Value,
|
||||
|
Loading…
Reference in New Issue
Block a user