Readonly
onSome editor operations fire multiple events at once.
To allow users to react to multiple events fired by a single operation,
the editor fires a begin update before the operation and an end update after the operation.
Whenever the editor fires onBeginUpdate
, it will also fire onEndUpdate
once the operation finishes.
Note that not all operations are bracketed by onBeginUpdate
and onEndUpdate
.
Readonly
onAn event emitted after composition has ended.
Readonly
onAn event emitted after composition has started.
Readonly
onFires after the editor completes the operation it fired onBeginUpdate
for.
Add a content widget. Widgets must have unique ids, otherwise they will be overwritten.
Add a glyph margin widget. Widgets must have unique ids, otherwise they will be overwritten.
Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten.
Change the view zones. View zones are lost when a new model is attached to the editor.
Create a collection of decorations. All decorations added through this collection will get the ownerId of the editor (meaning they will not show up in other editors). These decorations will be automatically cleared when the editor's model changes.
Optional
decorations: IModelDeltaDecoration[]All decorations added through this call will get the ownerId of this editor.
Use createDecorationsCollection
createDecorationsCollection
Execute a command on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
The source of the call.
The command to execute
Execute multiple (concomitant) commands on the editor.
The source of the call.
Execute edits on the editor. The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
The source of the call.
The edits to execute.
Optional
endCursorState: ICursorStateComputer | Selection[]Cursor state after the edits were applied.
Get an action that is a contribution to this editor.
The action or null if action not found.
Unique identifier of the contribution.
Get a contribution of this editor.
The contribution or null if contribution not found.
Unique identifier of the contribution.
Get all the decorations for a range (filtering out decorations from other editors).
Get the layout info for the editor.
Get all the decorations on a line (filtering out decorations from other editors).
Type the getModel() of IEditor.
Get the horizontal position (left offset) for the column w.r.t to the beginning of the line.
This method works only if the line lineNumber
is currently rendered (in the editor's viewport).
Use this method with caution.
Gets a specific editor option.
Gets all the editor computed options.
Returns the editor's configuration (without any validation or defaults).
Get the visible position for position
.
The result position takes scrolling into account and is relative to the top left corner of the editor.
Explanation 1: the results of this method will change for the same position
if the user scrolls the editor.
Explanation 2: the results of this method will not change if the container of the editor gets repositioned.
Warning: the results of this method are inaccurate for positions that are outside the current editor viewport.
Returns all actions associated with this editor.
Get the hit test target at coordinates clientX
and clientY
.
The coordinates are relative to the top-left of the viewport.
Hit test target or null if the coordinates fall outside the editor or the editor has no model.
Given a position, returns a column number that takes tab-widths into account.
Optional
handleInstructs the editor to remeasure its container. This method should be called when the container of the editor gets resized.
If a dimension is passed in, the passed in value will be used.
By default, this will also render the editor immediately. If you prefer to delay rendering to the next animation frame, use postponeRendering == true.
Optional
dimension: IDimensionOptional
postponeRendering: booleanLayout/Reposition a content widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Layout/Reposition a glyph margin widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition() and update appropriately.
Remove a content widget.
Remove a glyph margin widget.
Remove an overlay widget.
Restores the view state of the editor from a serializable object generated by saveViewState
.
Scroll vertically as necessary and reveal a line.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal a line centered vertically.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal a line centered vertically only if it lies outside the viewport.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal a line close to the top of the viewport, optimized for viewing a code definition.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal lines.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal lines centered vertically.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal lines centered vertically only if it lies outside the viewport.
Optional
scrollType: ScrollTypeScroll vertically as necessary and reveal lines close to the top of the viewport, optimized for viewing a code definition.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position centered vertically.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position centered vertically only if it lies outside the viewport.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a position close to the top of the viewport, optimized for viewing a code definition.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range at the top of the viewport.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range centered vertically.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition.
Optional
scrollType: ScrollTypeScroll vertically or horizontally as necessary and reveal a range close to the top of the viewport, optimized for viewing a code definition. Only if it lies outside the viewport.
Optional
scrollType: ScrollTypeSaves current view state of the editor in a serializable object.
Sets the current model attached to this editor. If the previous model was created by the editor via the value key in the options literal object, it will be destroyed. Otherwise, if the previous model was set via setModel, or the model key in the options literal object, the previous model will not be destroyed. It is safe to call setModel(null) to simply detach the current model from the editor.
Set the primary position of the cursor. This will remove any secondary cursors.
New primary cursor's position
Optional
source: stringSource of the call that caused the position
Change the scrollLeft of the editor's viewport.
Optional
scrollType: ScrollTypeChange the scroll position of the editor's viewport.
Optional
scrollType: ScrollTypeChange the scrollTop of the editor's viewport.
Optional
scrollType: ScrollTypeSet the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optional
source: stringSource of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optional
source: stringSource of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optional
source: stringSource of the call that caused the selection
Set the primary selection of the editor. This will remove any secondary cursors.
The new selection
Optional
source: stringSource of the call that caused the selection
Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.
The new selection
Optional
source: stringSource of the call that caused the selection
Update the editor's options after the editor has been created.
Readonly
onAn event emitted on a "contextmenu".
Readonly
onAn event emitted when editing failed because the editor is read-only.
Readonly
onAn event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).
Readonly
onAn event emitted when the text inside this editor or an editor widget lost focus.
Readonly
onAn event emitted when the configuration of the editor has changed. (e.g. editor.updateOptions()
)
Readonly
onAn event emitted when the cursor position has changed.
Readonly
onAn event emitted when the cursor selection has changed.
Readonly
onAn event emitted when hidden areas change in the editor (e.g. due to folding).
Readonly
onAn event emitted when the model of this editor has changed (e.g. editor.setModel()
).
Readonly
onAn event emitted when the content of the current model has changed.
Readonly
onAn event emitted when the decorations of the current model have changed.
Readonly
onAn event emitted when the language of the current model has changed.
Readonly
onAn event emitted when the language configuration of the current model has changed.
Readonly
onAn event emitted when the options of the current model has changed.
Readonly
onAn event emitted when the content width or content height in the editor has changed.
Readonly
onAn event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
Readonly
onAn event emitted when the text inside this editor or an editor widget gained focus.
Readonly
onAn event emitted when the layout of the editor has changed.
Readonly
onAn event emitted when users paste text in the editor.
Readonly
onAn event emitted when the scroll in the editor has changed.
Readonly
onAn event emitted on a "keydown".
Readonly
onAn event emitted on a "keyup".
Readonly
onAn event emitted on a "mousedown".
Readonly
onAn event emitted on a "mouseleave".
Readonly
onAn event emitted on a "mousemove".
Readonly
onAn event emitted on a "mouseup".
Readonly
onAn event emitted when the model of this editor is about to change (e.g. from editor.setModel()
).
An event emitted when the editor has been disposed.
A rich code editor.