The class that is responsible for drawing everything you see on the screen!

Related

editor.renderer

Constructors

Properties

Methods

$addResizeObserver $autosize $calcSteps $calculateWrappedTextChunks $computeLayerConfig $getLongestLine $moveTextAreaToCursor $renderChanges $updateCachedSize $updateCustomScrollbar $updateLines $updatePrintMargin $updateScrollBarH $updateScrollBarV $updateSizeAsync addGutterDecoration addToken adjustWrapLimit alignCursor animateScrolling attachToShadowRoot destroy freeze getAnimatedScroll getContainerElement getDisplayIndentGuides getFadeFoldWidgets getFirstFullyVisibleRow getFirstVisibleRow getHScrollBarAlwaysVisible getHighlightGutterLine getHighlightIndentGuides getLastFullyVisibleRow getLastVisibleRow getMouseEventTarget getPrintMarginColumn getScrollBottomRow getScrollLeft getScrollTop getScrollTopRow getShowGutter getShowInvisibles getShowPrintMargin getTextAreaContainer getTheme getVScrollBarAlwaysVisible hideComposition hideCursor hideTokensAfterPosition isScrollableBy onChangeNewLineMode onChangeTabSize onGutterResize onResize pixelToScreenCoordinates removeExtraToken removeGhostText removeGutterDecoration screenToTextCoordinates scrollBy scrollCursorIntoView scrollSelectionIntoView scrollTo scrollToLine scrollToRow scrollToX scrollToY setAnimatedScroll setAnnotations setCompositionText setCursorStyle setDisplayIndentGuides setFadeFoldWidgets setGhostText setHScrollBarAlwaysVisible setHighlightGutterLine setHighlightIndentGuides setMargin setMouseCursor setPadding setPrintMarginColumn setScrollMargin setSession setShowGutter setShowInvisibles setShowPrintMargin setStyle setTheme setVScrollBarAlwaysVisible showComposition showCursor textToScreenCoordinates unfreeze unsetStyle updateBackMarkers updateBreakpoints updateCharacterSize updateCursor updateFontSize updateFrontMarkers updateFull updateLines updateText visualizeBlur visualizeFocus

Constructors

  • Constructs a new VirtualRenderer within the container specified, applying the given theme.

    Parameters

    • Optional container: HTMLElement

      The root element of the editor

    • Optional theme: string

      The starting theme

    Returns VirtualRenderer

Properties

$allowBoldFonts: any
$changedLines: {
    firstRow: number;
    lastRow: number;
}

Type declaration

  • firstRow: number
  • lastRow: number
$changes: number
$composition: any
$cursorLayer: Cursor
$fontMetrics: FontMetrics
$frozen: boolean
$ghostText: {
    position: {
        column: number;
        row: any;
    };
    text: string;
}

Type declaration

  • position: {
        column: number;
        row: any;
    }
    • column: number
    • row: any
  • text: string
$ghostTextWidget: {
    className: string;
    column: number;
    el: HTMLDivElement;
    row: any;
}

Type declaration

  • className: string
  • column: number
  • el: HTMLDivElement
  • row: any
$gutter: HTMLDivElement
$gutterLayer: Gutter
$horizScroll: boolean
$keepTextAreaAtCursor: boolean
$loop: RenderLoop
$markerBack: Marker
$markerFront: Marker
$padding: number
$printMarginEl: HTMLDivElement
$resizeObserver: ResizeObserver
$resizeTimer: {
    schedule: { (timeout?: number): void; delay(timeout?: number): void; schedule: ...; call(): void; cancel(): void; isPending(): any; };
    call(): void;
    cancel(): void;
    delay(timeout?): void;
    isPending(): any;
    (timeout?): void;
}

Type declaration

    • (timeout?): void
    • Parameters

      • Optional timeout: number

      Returns void

  • schedule: { (timeout?: number): void; delay(timeout?: number): void; schedule: ...; call(): void; cancel(): void; isPending(): any; }
  • call:function
  • cancel:function
  • delay:function
    • Parameters

      • Optional timeout: number

      Returns void

  • isPending:function
$scrollAnimation: {
    from: any;
    steps: any[];
    to: number;
}

Type declaration

  • from: any
  • steps: any[]
  • to: number
$scrollDecorator: Decorator
$size: {
    $dirty: boolean;
    height: number;
    scrollerHeight: number;
    scrollerWidth: number;
    width: number;
}

Type declaration

  • $dirty: boolean
  • height: number
  • scrollerHeight: number
  • scrollerWidth: number
  • width: number
$stopAnimation: boolean
$textLayer: Text
$themeId: any
$timer: number
$vScroll: boolean
CHANGE_CURSOR: number
CHANGE_FULL: number
CHANGE_GUTTER: number
CHANGE_H_SCROLL: number
CHANGE_LINES: number
CHANGE_MARKER: number
CHANGE_MARKER_BACK: number
CHANGE_MARKER_FRONT: number
CHANGE_SCROLL: number
CHANGE_SIZE: number
CHANGE_TEXT: number
STEPS: number
_rows: any
canvas: HTMLDivElement
characterWidth: number
container: HTMLElement
content: HTMLElement
cursorPos: {
    column: number;
    row: number;
}

Type declaration

  • column: number
  • row: number
desiredHeight: any
gutterWidth: any
layerConfig: {
    characterWidth: number;
    firstRow: number;
    firstRowScreen: number;
    gutterOffset: number;
    height: number;
    lastRow: number;
    lineHeight: number;
    maxHeight: number;
    minHeight: number;
    offset: number;
    padding: number;
    width: number;
}

Type declaration

  • characterWidth: number
  • firstRow: number
  • firstRowScreen: number
  • gutterOffset: number
  • height: number
  • lastRow: number
  • lineHeight: number
  • maxHeight: number
  • minHeight: number
  • offset: number
  • padding: number
  • width: number
lineHeight: number
margin: {
    bottom: number;
    h: number;
    left: number;
    right: number;
    top: number;
    v: number;
}

Type declaration

  • bottom: number
  • h: number
  • left: number
  • right: number
  • top: number
  • v: number
resizing: number
scrollBar: VScrollBar
scrollBarH: HScrollbar
scrollBarV: VScrollbar
scrollLeft: number
scrollMargin: {
    bottom: number;
    h: number;
    left: number;
    right: number;
    top: number;
    v: number;
}

Type declaration

  • bottom: number
  • h: number
  • left: number
  • right: number
  • top: number
  • v: number
scrollTop: number
scroller: HTMLElement
session: EditSession

Methods

  • Calculates and organizes text into wrapped chunks. Initially splits the text by newline characters, then further processes each line based on display tokens and session settings for tab size and wrapping limits.

    Parameters

    • text: string
    • position: Point

    Returns {
        text: string;
        wrapped: boolean;
    }[]

  • Parameters

    • changes: number
    • Optional force: boolean

    Returns number

  • Parameters

    • Optional force: any
    • Optional gutterWidth: any
    • Optional width: any
    • Optional height: any

    Returns number

  • Deprecated; (moved to [[EditSession]])

    Parameters

    • row: any
    • className: any

    Returns void

    Deprecated

  • Parameters

    • text: string
    • type: string
    • row: number
    • Optional column: number

    Returns void

  • Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

    Returns boolean

  • Parameters

    • cursor: Point
    • Optional alignment: number

    Returns number

  • Parameters

    • fromValue: any
    • Optional callback: any

    Returns void

  • Returns the root element containing this renderer.

    Returns HTMLElement

  • Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

    Returns number

  • [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow}

    Returns number

  • Returns whether the horizontal scrollbar is set to be always visible.

    Returns boolean

  • Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

    Returns number

  • [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow}

    Returns number

  • Returns the element that the mouse events are attached to

    Returns HTMLElement

  • Returns whether the print margin column is being shown or not.

    Returns number

  • Returns the last visible row, regardless of whether it's fully visible or not.

    Returns number

  • Returns the first visible row, regardless of whether it's fully visible or not.

    Returns number

  • Returns whether invisible characters are being shown or not.

    Returns boolean

  • Returns whether the print margin is being shown or not.

    Returns boolean

  • Returns the element to which the hidden text area is added.

    Returns HTMLElement

  • [Returns the path of the current theme.]{: #VirtualRenderer.getTheme}

    Returns string

  • Returns whether the horizontal scrollbar is set to be always visible.

    Returns boolean

  • Parameters

    • row: any
    • column: any

    Returns {
        type: string;
        value: string;
    }[]

  • Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

    Parameters

    • deltaX: number

      The x value to scroll by

    • deltaY: number

      The y value to scroll by

    Returns boolean

  • Internal

    [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}

    Parameters

    • Optional force: boolean

      If true, recomputes the size, even if the height and width haven't changed

    • Optional gutterWidth: number

      The width of the gutter in pixels

    • Optional width: number

      The width of the editor in pixels

    • Optional height: number

      The hiehgt of the editor, in pixels

    Returns number

  • Parameters

    • x: number
    • y: number

    Returns ScreenCoordinates

  • Deprecated; (moved to [[EditSession]])

    Parameters

    • row: any
    • className: any

    Returns void

    Deprecated

  • Scrolls the editor across both x- and y-axes.

    Parameters

    • deltaX: number

      The x value to scroll by

    • deltaY: number

      The y value to scroll by

    Returns void

  • Scrolls the cursor into the first visibile area of the editor

    Parameters

    • Optional cursor: Point
    • Optional offset: number
    • Optional $viewMargin: {
          bottom?: any;
          top?: any;
      }
      • Optional bottom?: any
      • Optional top?: any

    Returns void

  • Parameters

    • anchor: Point
    • lead: Point
    • Optional offset: number

    Returns void

  • Scrolls the editor across both x- and y-axes.

    Parameters

    • x: number

      The x value to scroll to

    • y: number

      The y value to scroll to

    Returns void

  • Gracefully scrolls the editor to the row indicated.

    Parameters

    • line: number

      A line number

    • center: boolean

      If true, centers the editor the to indicated line

    • animate: boolean

      If true animates scrolling

    • Optional callback: (() => void)

      Function to be called after the animation has finished

        • (): void
        • Returns void

    Returns void

  • Gracefully scrolls from the top of the editor to the row indicated.

    Parameters

    • row: number

      A row id

    Returns void

    Related

    EditSession.setScrollTop

  • Scrolls the editor across the x-axis to the pixel indicated.

    Parameters

    • scrollLeft: number

      The position to scroll to

    Returns void

  • Scrolls the editor to the y pixel indicated.

    Parameters

    • scrollTop: number

      The position to scroll to

    Returns void

  • Identifies whether you want to have an animated scroll or not.

    Parameters

    • shouldAnimate: boolean

      Set to true to show animated scrolls

    Returns void

  • Sets annotations for the gutter.

    Parameters

    • annotations: Annotation[]

      An array containing annotations

    Returns void

  • Parameters

    • text: string

      A string of text to use

      Sets the inner text of the current composition to text.

    Returns void

  • Identifies whether you want to show the horizontal scrollbar or not.

    Parameters

    • alwaysVisible: boolean

      Set to true to make the horizontal scroll bar visible

    Returns void

  • Parameters

    • Optional top: number
    • Optional bottom: number
    • Optional left: number
    • Optional right: number

    Returns void

  • Sets the padding for all the layers.

    Parameters

    • padding: number

      A new padding value (in pixels)

    Returns void

  • Identifies whether you want to show the print margin column or not.

    Parameters

    • printMarginColumn: number

      Set to true to show the print margin column

    Returns void

  • Parameters

    • Optional top: number
    • Optional bottom: number
    • Optional left: number
    • Optional right: number

    Returns void

  • Associates the renderer with an [[EditSession EditSession]].

    Parameters

    • session: EditSession

      The session to associate with

    Returns void

  • Identifies whether you want to show the gutter or not.

    Parameters

    • show: boolean

      Set to true to show the gutter

    Returns void

  • Identifies whether you want to show invisible characters or not.

    Parameters

    • showInvisibles: boolean

      Set to true to show invisibles

    Returns void

  • Identifies whether you want to show the print margin or not.

    Parameters

    • showPrintMargin: boolean

      Set to true to show the print margin

    Returns void

  • [Adds a new class, style, to the editor.]{: #VirtualRenderer.setStyle}

    Parameters

    • style: string

      A class name

    • Optional include: boolean

    Returns void

  • [Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.]{: #VirtualRenderer.setTheme}

    Parameters

    • Optional theme: string | Theme

      The path to a theme

    • Optional cb: (() => void)

      optional callback

        • (): void
        • Returns void

    Returns void

  • Identifies whether you want to show the horizontal scrollbar or not.

    Parameters

    • alwaysVisible: boolean

      Set to true to make the horizontal scroll bar visible

    Returns void

  • Returns an object containing the pageX and pageY coordinates of the document position.

    Parameters

    • row: number

      The document row position

    • column: number

      The document column position

    Returns {
        pageX: number;
        pageY: number;
    }

    • pageX: number
    • pageY: number
  • [Removes the class style from the editor.]{: #VirtualRenderer.unsetStyle}

    Parameters

    • style: string

      A class name

    Returns void

  • Triggers a full update of all the layers, for all the rows.

    Parameters

    • Optional force: boolean

      If true, forces the changes through

    Returns void

  • Triggers a partial update of the text, from the range given by the two parameters.

    Parameters

    • firstRow: number

      The first row to update

    • lastRow: number

      The last row to update

    • Optional force: boolean

    Returns void

Generated using TypeDoc