A rich diff editor.

Hierarchy

Index

Events

onDidDispose

onDidUpdateDiff

  • An event emitted when the diff information computed by this diff editor has been updated.

    Parameters

    • listener: function
        • (): void
        • Returns void

    Returns IDisposable

Methods

dispose

  • dispose(): void

focus

  • focus(): void

getDiffLineInformationForModified

  • Get information based on computed diff about a line number from the modified model. If the diff computation is not finished or the model is missing, will return null.

    Parameters

    • lineNumber: number

    Returns IDiffLineInformation | null

getDiffLineInformationForOriginal

  • Get information based on computed diff about a line number from the original model. If the diff computation is not finished or the model is missing, will return null.

    Parameters

    • lineNumber: number

    Returns IDiffLineInformation | null

getDomNode

  • getDomNode(): HTMLElement

getEditorType

  • getEditorType(): string

getId

  • getId(): string

getLineChanges

  • getLineChanges(): ILineChange[] | null
  • Get the computed diff information.

    Returns ILineChange[] | null

getModel

getModifiedEditor

getOriginalEditor

getPosition

getSelection

getSelections

  • getSelections(): Selection[] | null

getSupportedActions

  • getSupportedActions(): IEditorAction[]

getVisibleColumnFromPosition

  • getVisibleColumnFromPosition(position: IPosition): number

hasTextFocus

  • hasTextFocus(): boolean

layout

  • Instructs the editor to remeasure its container. This method should be called when the container of the editor gets resized.

    Parameters

    Returns void

restoreViewState

revealLine

  • revealLine(lineNumber: number, scrollType?: ScrollType): void

revealLineInCenter

  • revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void

revealLineInCenterIfOutsideViewport

  • revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void

revealLines

  • revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealLinesInCenter

  • revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealLinesInCenterIfOutsideViewport

  • revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void

revealPosition

revealPositionInCenter

revealPositionInCenterIfOutsideViewport

revealRange

revealRangeAtTop

revealRangeInCenter

revealRangeInCenterIfOutsideViewport

  • revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void

saveViewState

setModel

  • 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.

    Parameters

    Returns void

setPosition

  • Set the primary position of the cursor. This will remove any secondary cursors.

    Parameters

    • position: IPosition

      New primary cursor's position

    Returns void

setSelection

  • setSelection(selection: IRange): void
  • setSelection(selection: Range): void
  • setSelection(selection: ISelection): void
  • setSelection(selection: Selection): void

setSelections

  • setSelections(selections: ISelection[]): void
  • Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.

    Parameters

    • selections: ISelection[]

    Returns void

trigger

  • trigger(source: string, handlerId: string, payload: any): void
  • Directly trigger a handler or an editor action.

    Parameters

    • source: string

      The source of the call.

    • handlerId: string

      The id of the handler or the id of a contribution.

    • payload: any

      Extra data to be sent to the handler.

    Returns void

updateOptions