Created
February 4, 2019 06:40
-
-
Save srishanbhattarai/9137b1c92d0e33829d21c476d2d7a520 to your computer and use it in GitHub Desktop.
Skeleton of the recv() method for eventhandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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