Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class Buffer {
  2. getLines() {
  3. return new Promise((resolve) => resolve(['exciting', 'lines']));
  4. }
  5. }
  6.  
  7. class Neovim {
  8. getBuffer() {
  9. return new Promise((resolve) => resolve(new Buffer()));
  10. }
  11. }
  12.  
  13. // Get lines of current buffer
  14. nvim.getBuffer().then(buffer => buffer.getLines()).then(lines => {
  15. // Do something with `lines`
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement