Editor ‹ Chocolat API

Editor.current()

Class method that returns the current Editor.

Returns Editor – the active editor.

.document()

The document edited by this editor.

Returns Document – the document being edited.

.tab()

The containing tab.

Returns Tab – The containing tab.

.window()

The containing window.

Returns MainWindow – The containing window.

.selection

Get or set the selected text in this editor.

Returns Range – the range of the selected text.

.visibleRange()

Get the range of text that is visible in this editor.

Returns Range – the range of visible text.

.selectionContext()

Get the context (list of scopes) at the editor's selection.

Returns Array – a list of scopes for the selection.

.insertSnippet(snippet)

Insert a snippet where the cursor is located.

  • snippet String – a snippet.

.storage()

Access the storage object of the Editor (see Storage class).

Returns Storage – the storage.