Skip to content

Instantly share code, notes, and snippets.

@srishanbhattarai
Created February 4, 2019 06:40
Show Gist options
  • Save srishanbhattarai/9137b1c92d0e33829d21c476d2d7a520 to your computer and use it in GitHub Desktop.
Save srishanbhattarai/9137b1c92d0e33829d21c476d2d7a520 to your computer and use it in GitHub Desktop.
Skeleton of the recv() method for eventhandler
// Rest of the stuff remains the same.
fn recv(&mut self) {
let receiver = self.nvim.session.start_event_loop_channel();
for (event, values) in receiver {
match Messages::from(event) {
Messages::Add => {
// do stuff
}
Messages::Multiply => {
// do stuff
}
Messages::Unknown(uevent) => {
// unknown event
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment