mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 01:43:47 +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 {
|
for keybinding in parsed_keybindings {
|
||||||
add_keybinding(
|
add_keybinding(
|
||||||
|
&keybinding.name,
|
||||||
&keybinding.mode,
|
&keybinding.mode,
|
||||||
keybinding,
|
keybinding,
|
||||||
config,
|
config,
|
||||||
@ -729,7 +730,9 @@ pub(crate) fn create_keybindings(config: &Config) -> Result<KeybindingsMode, She
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::only_used_in_recursion)]
|
||||||
fn add_keybinding(
|
fn add_keybinding(
|
||||||
|
name: &Option<Value>,
|
||||||
mode: &Value,
|
mode: &Value,
|
||||||
keybinding: &ParsedKeybinding,
|
keybinding: &ParsedKeybinding,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
@ -752,6 +755,7 @@ fn add_keybinding(
|
|||||||
Value::List { vals, .. } => {
|
Value::List { vals, .. } => {
|
||||||
for inner_mode in vals {
|
for inner_mode in vals {
|
||||||
add_keybinding(
|
add_keybinding(
|
||||||
|
name,
|
||||||
inner_mode,
|
inner_mode,
|
||||||
keybinding,
|
keybinding,
|
||||||
config,
|
config,
|
||||||
|
@ -5,6 +5,7 @@ use crate::{engine::Closure, FromValue};
|
|||||||
/// Definition of a parsed keybinding from the config object
|
/// Definition of a parsed keybinding from the config object
|
||||||
#[derive(Clone, Debug, FromValue, IntoValue, Serialize, Deserialize)]
|
#[derive(Clone, Debug, FromValue, IntoValue, Serialize, Deserialize)]
|
||||||
pub struct ParsedKeybinding {
|
pub struct ParsedKeybinding {
|
||||||
|
pub name: Option<Value>,
|
||||||
pub modifier: Value,
|
pub modifier: Value,
|
||||||
pub keycode: Value,
|
pub keycode: Value,
|
||||||
pub event: Value,
|
pub event: Value,
|
||||||
|
Loading…
Reference in New Issue
Block a user