Options
All
  • Public
  • Public/Protected
  • All
Menu

A rich diff editor.

Hierarchy

Index

Events

onDidChangeModel: IEvent<void>

An event emitted when the diff model is changed (i.e. the diff editor shows new content).

onDidUpdateDiff: IEvent<void>

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

Methods

  • dispose(): void
  • focus(): void
  • getContainerDomNode(): HTMLElement
  • 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

  • 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

  • getEditorType(): string
  • getId(): string
  • getVisibleColumnFromPosition(position: IPosition): number
  • hasTextFocus(): boolean
  • Instructs 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.

    Parameters

    Returns void

  • revealLine(lineNumber: number, scrollType?: ScrollType): void
  • revealLineInCenter(lineNumber: number, scrollType?: ScrollType): void
  • revealLineInCenterIfOutsideViewport(lineNumber: number, scrollType?: ScrollType): void
  • revealLineNearTop(lineNumber: number, scrollType?: ScrollType): void
  • revealLines(startLineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • revealLinesInCenter(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • revealLinesInCenterIfOutsideViewport(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • revealLinesNearTop(lineNumber: number, endLineNumber: number, scrollType?: ScrollType): void
  • revealRangeInCenterIfOutsideViewport(range: IRange, scrollType?: ScrollType): void
  • revealRangeNearTopIfOutsideViewport(range: IRange, scrollType?: ScrollType): void
  • 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(position: IPosition, source?: string): void
  • Set the primary position of the cursor. This will remove any secondary cursors.

    Parameters

    • position: IPosition

      New primary cursor's position

    • Optional source: string

      Source of the call that caused the position

    Returns void

  • setSelection(selection: IRange, source?: string): void
  • setSelection(selection: Range, source?: string): void
  • setSelection(selection: ISelection, source?: string): void
  • setSelection(selection: Selection, source?: string): void
  • setSelections(selections: readonly ISelection[], source?: string): void
  • Set the selections for all the cursors of the editor. Cursors will be removed or added, as necessary.

    Parameters

    • selections: readonly ISelection[]

      The new selection

    • Optional source: string

      Source of the call that caused the selection

    Returns void

  • 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