Added dictionary plugin and switched from a Mutex
to an RwLock
in the anyrun_plugin
crate
This change means that `get_matches` no longer has access to a mutable version of the state of the plugin. A redesign is needed to allow for this if needed.
This commit is contained in:
@@ -33,10 +33,9 @@ fn info() -> PluginInfo {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_matches(input: RString, config: &mut Config) -> RVec<Match> {
|
||||
let prefix_with_delim = format!("{}", config.prefix);
|
||||
if input.starts_with(&prefix_with_delim) {
|
||||
let (_, command) = input.split_once(&prefix_with_delim).unwrap();
|
||||
fn get_matches(input: RString, config: &Config) -> RVec<Match> {
|
||||
if input.starts_with(&config.prefix) {
|
||||
let (_, command) = input.split_once(&config.prefix).unwrap();
|
||||
if !command.is_empty() {
|
||||
vec![Match {
|
||||
title: command.into(),
|
||||
|
Reference in New Issue
Block a user