Ace API Reference
    Preparing search index...

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

    Index

    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 getHighlightGutterLine getHighlightIndentGuides getHScrollBarAlwaysVisible 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 setHighlightGutterLine setHighlightIndentGuides setHScrollBarAlwaysVisible 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

      • Optionalcontainer: HTMLElement

        The root element of the editor

      • Optionaltheme: string

        The starting theme

      Returns VirtualRenderer

    Properties

    _rows: any
    $allowBoldFonts: any
    $changedLines: { firstRow: number; lastRow: number }
    $changes: number
    $composition: any
    $cursorLayer: Cursor
    $fontMetrics: FontMetrics
    $frozen: boolean
    $ghostText: { position: { column: number; row: any }; text: string }
    $ghostTextWidget: {
        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?: number): void;
        isPending(): any;
        (timeout?: number): void;
    }
    $scrollAnimation: { from: any; steps: any[]; to: number }
    $scrollDecorator: Decorator
    $size: {
        $dirty: boolean;
        height: number;
        scrollerHeight: number;
        scrollerWidth: number;
        width: number;
    }
    $stopAnimation: boolean
    $textLayer: Text
    $themeId: any
    $timer: number
    $vScroll: boolean
    canvas: HTMLDivElement
    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
    characterWidth: number
    container: HTMLElement
    content: HTMLElement
    cursorPos: { 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;
    }
    lineHeight: number
    margin: {
        bottom: number;
        h: number;
        left: number;
        right: number;
        top: number;
        v: number;
    }
    resizing: number
    scrollBar: VScrollBar
    scrollBarH: HScrollbar
    scrollBarV: VScrollbar
    scroller: HTMLElement
    scrollLeft: number
    scrollMargin: {
        bottom: number;
        h: number;
        left: number;
        right: number;
        top: number;
        v: number;
    }
    scrollTop: number
    session: EditSession
    STEPS: number

    Methods

    • Parameters

      • fromValue: number
      • toValue: number

      Returns any[]

    • 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

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

    • Parameters

      • changes: number
      • Optionalforce: boolean

      Returns number

    • Parameters

      • Optionalforce: any
      • OptionalgutterWidth: any
      • Optionalwidth: any
      • Optionalheight: any

      Returns number

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

      Parameters

      • row: any
      • className: any

      Returns void

    • Parameters

      • text: string
      • type: string
      • row: number
      • Optionalcolumn: 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

      • fromValue: any
      • Optionalcallback: 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

      • Optionalforce: boolean

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

      • OptionalgutterWidth: number

        The width of the gutter in pixels

      • Optionalwidth: number

        The width of the editor in pixels

      • Optionalheight: number

        The hiehgt of the editor, in pixels

      Returns number

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

      Parameters

      • row: any
      • className: any

      Returns void

    • 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

      • Optionalcursor: Ace.Point
      • Optionaloffset: number
      • Optional$viewMargin: { bottom?: any; top?: any }

      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

      • Optionalcallback: () => void

        Function to be called after the animation has finished

      Returns void

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

      Parameters

      • row: number

        A row id

      Returns void

    • 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

    • Parameters

      • text: string

        A string of text to use

        Sets the inner text of the current composition to text.

      Returns void

    • Parameters

      • shouldHighlight: boolean

      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

      • Optionaltop: number
      • Optionalbottom: number
      • Optionalleft: number
      • Optionalright: number

      Returns void

    • Parameters

      • cursorStyle: string

        A css cursor style

      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

      • Optionaltop: number
      • Optionalbottom: number
      • Optionalleft: number
      • Optionalright: 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

      • Optionalinclude: 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

      • Optionaltheme: string | Ace.Theme

        The path to a theme

      • Optionalcb: () => void

        optional callback

      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 }

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

      • Optionalforce: 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

      • Optionalforce: boolean

      Returns void