Skip to content

Instantly share code, notes, and snippets.

@billyvg
Last active June 22, 2017 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billyvg/f9cce50acbd00515c91dce0e7e346f29 to your computer and use it in GitHub Desktop.
Save billyvg/f9cce50acbd00515c91dce0e7e346f29 to your computer and use it in GitHub Desktop.
class Buffer {
getLines() {
return new Promise((resolve) => resolve(['exciting', 'lines']));
}
}
class Neovim {
getBuffer() {
return new Promise((resolve) => resolve(new Buffer()));
}
}
// Get lines of current buffer
nvim.getBuffer().then(buffer => buffer.getLines()).then(lines => {
// Do something with `lines`
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment