From 62eeeec2014bd9299b4ac21c535c1e525f6dc6ed Mon Sep 17 00:00:00 2001 From: daa Date: Thu, 31 Mar 2016 15:08:32 +0300 Subject: [PATCH] Fix event processing --- src/nvim.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nvim.rs b/src/nvim.rs index f825996..5b3f68f 100644 --- a/src/nvim.rs +++ b/src/nvim.rs @@ -58,11 +58,13 @@ fn nvim_cb(method: &str, params: Vec) { for ev in params { if let Value::Array(ev_args) = ev { if let Value::String(ref ev_name) = ev_args[0] { - let args = match ev_args[1] { - Value::Array(ref ar) => ar.clone(), - _ => vec![], - }; - call(ev_name, args); + for ref local_args in ev_args.iter().skip(1) { + let args = match *local_args { + &Value::Array(ref ar) => ar.clone(), + _ => vec![], + }; + call(ev_name, args); + } } else { println!("Unsupported event {:?}", ev_args); }