mirror of https://github.com/helix-editor/helix
slim down interfact even more
parent
7d63468b83
commit
0eb0be55a3
|
@ -551,12 +551,6 @@ impl std::str::FromStr for MappableCommand {
|
||||||
args,
|
args,
|
||||||
doc,
|
doc,
|
||||||
})
|
})
|
||||||
} else if self::engine::ScriptingEngine::is_exported(name) {
|
|
||||||
Some(MappableCommand::Typable {
|
|
||||||
name: name.to_owned(),
|
|
||||||
args,
|
|
||||||
doc: "plugin function".to_string(),
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,10 +99,6 @@ impl ScriptingEngine {
|
||||||
) -> Vec<(String, i64)> {
|
) -> Vec<(String, i64)> {
|
||||||
PLUGIN_SYSTEM.0.fuzzy_match(fuzzy_matcher, input)
|
PLUGIN_SYSTEM.0.fuzzy_match(fuzzy_matcher, input)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_exported(ident: &str) -> bool {
|
|
||||||
PLUGIN_SYSTEM.0.is_exported(ident)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PluginSystem for NoEngine {}
|
impl PluginSystem for NoEngine {}
|
||||||
|
@ -174,9 +170,4 @@ pub trait PluginSystem {
|
||||||
) -> Vec<(String, i64)> {
|
) -> Vec<(String, i64)> {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks if this identifier is available in the global environment in the engine.
|
|
||||||
fn is_exported(&self, _ident: &str) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -345,7 +345,9 @@ impl super::PluginSystem for SteelScriptingEngine {
|
||||||
.map(|x| (x.0.to_string(), x.1))
|
.map(|x| (x.0.to_string(), x.1))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SteelScriptingEngine {
|
||||||
fn is_exported(&self, ident: &str) -> bool {
|
fn is_exported(&self, ident: &str) -> bool {
|
||||||
EXPORTED_IDENTIFIERS
|
EXPORTED_IDENTIFIERS
|
||||||
.identifiers
|
.identifiers
|
||||||
|
@ -353,9 +355,7 @@ impl super::PluginSystem for SteelScriptingEngine {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.contains(ident)
|
.contains(ident)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl SteelScriptingEngine {
|
|
||||||
// Attempt to fetch the keymap for the extension
|
// Attempt to fetch the keymap for the extension
|
||||||
fn get_keymap_for_extension<'a>(cx: &'a mut Context) -> Option<SteelVal> {
|
fn get_keymap_for_extension<'a>(cx: &'a mut Context) -> Option<SteelVal> {
|
||||||
// Get the currently activated extension, also need to check the
|
// Get the currently activated extension, also need to check the
|
||||||
|
|
Loading…
Reference in New Issue