Skip to content

Instantly share code, notes, and snippets.

// From
nvim.tabpage.then(tabpage => tabpage.window).then(window => window.buffer).then(buffer => buffer.lines).then(lines => lines);
// To
const lines = await nvim.tabpage.window.buffer.lines;
// or without await
nvim.tabpage.window.buffer.lines.then(lines => lines);
nvim.getBuffer().getLines().then(lines => lines);
const lines = await nvim.buffer.lines;
const buffer = await nvim.buffer;
const lines = await buffer.lines;
const buffer = await nvim.getBuffer();
const lines = await buffer.getLines();
class Buffer {
getLines() {
return new Promise((resolve) => resolve(['exciting', 'lines']));
}
}
class Neovim {
getBuffer() {
return new Promise((resolve) => resolve(new Buffer()));
}
// Desired API
const name = await neovim.buffer.name; // neovim.buffer.name((name) => name);
class Buffer {
get name() {}
remove(start, end) {}
}
class Neovim {
get buffer() {
Process: 2.28-x64-chromedriver [17759]
Path: /Users/USER/*/2.28-x64-chromedriver
Identifier: 2.28-x64-chromedriver
Version: 0
Code Type: X86-64 (Native)
Parent Process: java [17757]
Responsible: 2.28-x64-chromedriver [17759]
User ID: 501
Date/Time: 2017-04-28 12:18:50.389 -0700
class MainView extends React.Component {
_addEntry(e) {
this.props.navigator.push({
title: 'New',
component: AddEntryView,
rightButtonTitle: 'Save',
onRightButtonPress: (e) => {
// save
},
});
@billyvg
billyvg / grunt-flo.js
Created May 28, 2014 23:56
grunt task for integrating with fb-flo
module.exports = function(grunt) {
// easy way to load grunt tasks in package.json
// require('load-grunt-tasks')(grunt);
// or the normal way
grunt.task.loadNpmTasks('grunt-concurrent');
grunt.task.loadNpmTasks('grunt-contrib-connect');
grunt.task.loadNpmTasks('grunt-contrib-watch');
// configure local dev server
grunt.config('connect.dev', {