Fix event processing
This commit is contained in:
parent
2d04cbbdc0
commit
62eeeec201
12
src/nvim.rs
12
src/nvim.rs
@ -58,11 +58,13 @@ fn nvim_cb(method: &str, params: Vec<Value>) {
|
|||||||
for ev in params {
|
for ev in params {
|
||||||
if let Value::Array(ev_args) = ev {
|
if let Value::Array(ev_args) = ev {
|
||||||
if let Value::String(ref ev_name) = ev_args[0] {
|
if let Value::String(ref ev_name) = ev_args[0] {
|
||||||
let args = match ev_args[1] {
|
for ref local_args in ev_args.iter().skip(1) {
|
||||||
Value::Array(ref ar) => ar.clone(),
|
let args = match *local_args {
|
||||||
_ => vec![],
|
&Value::Array(ref ar) => ar.clone(),
|
||||||
};
|
_ => vec![],
|
||||||
call(ev_name, args);
|
};
|
||||||
|
call(ev_name, args);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("Unsupported event {:?}", ev_args);
|
println!("Unsupported event {:?}", ev_args);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user