atom-outlet

0.13.1 • Public • Published

atom-outlet

Build Status

Library to create outlet

  • Close from keyboard without focusing
  • Hide from keyboard without focusing
  • Relocate from keyboard without focusing
  • Emulate hiding outlet in center workspace by relocating to dock.

Related

Atom package outlet-manager provides useful commands to manipulate outlets in workspace in uniform manner.

Example

const outlet = require('atom-outlet')

// outlet.create return instance of TextEditor
// With special `open`, `relocate`, `show`, `hide`, `toggle`, `focus`, `toggleFocus`, `link` methods.
const editor = outlet.create({
  title: 'Sample outlet',
  classList: ['sample'],
  defaultLocation: 'bottom'
  extendsTextEditor: true
})

await editor.open()
editor.hide() // atom.workspace.hide(editor)
editor.show() // show dock
editor.relocate() // relocate to center workspace
editor.toggle()
editor.show()
editor.focus()

Default options for create

const DEFAULT_EDITOR_OPTIONS = {
  buffer: undefined,
  autoHeight: false
}

const DEFAULT_OPTIONS = {
  editorOptions: DEFAULT_EDITOR_OPTIONS, // pass-through-ed to `new TextEditor(editorOptions)`.
  allowedLocations: ['center', 'bottom'],  // One of ['center', 'bottom', 'left', 'right']
  defaultLocation: ['bottom'], // One of ['center', 'bottom', 'left', 'right']
  split: 'right', // Which direction  to split in center workspace
  title: undefined,
  trackModified: false, // When false, you won't be asked to save when closing outlet
  classList: [],
  useAdjacentPane: true, // By default pick adjacent pane to open outlet if exists.
}

Readme

Keywords

none

Package Sidebar

Install

npm i atom-outlet

Weekly Downloads

1

Version

0.13.1

License

MIT

Unpacked Size

29.5 kB

Total Files

7

Last publish

Collaborators

  • t9md