Skip to content

slap-editor/editor-widget

This branch is 1 commit ahead of, 5 commits behind master.

Folders and files

NameName
Last commit message
Last commit date
Jun 14, 2015
Jul 4, 2016
Jun 13, 2015
Jun 6, 2015
Oct 1, 2015
Jun 6, 2015
Sep 22, 2016
Jan 3, 2016
Jun 6, 2015
Apr 19, 2017

Repository files navigation

editor-widget Build Status

Editor widget for blessed used by the slap text editor

Example

const blessed = require('blessed');
const Editor = require('editor-widget');

const screen = blessed.screen({smartCSR: true, title: "editor-widget example"});
const editor = new Editor({
  // normal blessed widget, use like you would any other blessed element
  parent: screen,
  top: 0,
  left: 0,
  width: '100%',
  height: '100%'
});

const filePath = './file.txt';
editor.open(filePath);
screen.key(['C-s'], (ch, key) => { editor.save(filePath); });

screen.key(['escape', 'q', 'C-c'], (ch, key) => { process.exit(0); });
screen.render();

In use

Here are some projects that use editor-widget: