mirror of https://github.com/helix-editor/helix
remove global keybindings thread local
parent
88be9f9191
commit
d7ef4824e1
|
@ -112,7 +112,6 @@ thread_local! {
|
||||||
pub static REVERSE_BUFFER_MAP: SteelVal =
|
pub static REVERSE_BUFFER_MAP: SteelVal =
|
||||||
SteelVal::boxed(SteelVal::empty_hashmap());
|
SteelVal::boxed(SteelVal::empty_hashmap());
|
||||||
|
|
||||||
pub static GLOBAL_KEYBINDING_MAP: SteelVal = get_keymap().into_steelval().unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_keymap_api(engine: &mut Engine, api: KeyMapApi) {
|
fn load_keymap_api(engine: &mut Engine, api: KeyMapApi) {
|
||||||
|
@ -137,11 +136,6 @@ fn load_keymap_api(engine: &mut Engine, api: KeyMapApi) {
|
||||||
REVERSE_BUFFER_MAP.with(|x| x.clone()),
|
REVERSE_BUFFER_MAP.with(|x| x.clone()),
|
||||||
);
|
);
|
||||||
|
|
||||||
module.register_value(
|
|
||||||
"*global-keybinding-map*",
|
|
||||||
GLOBAL_KEYBINDING_MAP.with(|x| x.clone()),
|
|
||||||
);
|
|
||||||
|
|
||||||
engine.register_module(module);
|
engine.register_module(module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +527,7 @@ fn load_configuration_api(engine: &mut Engine, generate_sources: bool) {
|
||||||
r#"
|
r#"
|
||||||
(provide update-configuration!)
|
(provide update-configuration!)
|
||||||
(define (update-configuration!)
|
(define (update-configuration!)
|
||||||
(helix.update-configuration! *helix.cx*))
|
(helix.update-configuration! *helix.config*))
|
||||||
"#,
|
"#,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -542,7 +536,7 @@ fn load_configuration_api(engine: &mut Engine, generate_sources: bool) {
|
||||||
r#"
|
r#"
|
||||||
(provide get-keybindings)
|
(provide get-keybindings)
|
||||||
(define (get-keybindings)
|
(define (get-keybindings)
|
||||||
(helix.get-keybindings *helix.cx*))
|
(helix.get-keybindings *helix.config*))
|
||||||
"#,
|
"#,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -1007,8 +1001,7 @@ impl SteelScriptingEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refer to the global keybinding map for the rest
|
None
|
||||||
Some(GLOBAL_KEYBINDING_MAP.with(|x| x.clone()))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue