Ace API Reference
    Preparing search index...

    Class VirtualRenderer

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

    Hierarchy

    • EventEmitter<Ace.VirtualRendererEvents>
    • OptionsProvider<Ace.VirtualRendererOptions>
      • VirtualRenderer
    Index

    Constructors

    Properties

    Methods

    addEventListener addGutterDecoration addToken adjustWrapLimit alignCursor animateScrolling attachToShadowRoot destroy freeze getAnimatedScroll getContainerElement getDisplayIndentGuides getFadeFoldWidgets getFirstFullyVisibleRow getFirstVisibleRow getHighlightGutterLine getHighlightIndentGuides getHScrollBarAlwaysVisible getLastFullyVisibleRow getLastVisibleRow getMouseEventTarget getOption getOptions getPrintMarginColumn getScrollBottomRow getScrollLeft getScrollTop getScrollTopRow getShowGutter getShowInvisibles getShowPrintMargin getTextAreaContainer getTheme getVScrollBarAlwaysVisible hideComposition hideCursor hideTokensAfterPosition isScrollableBy off on once pixelToScreenCoordinates removeAllListeners removeDefaultHandler removeEventListener removeExtraToken removeGhostText removeGutterDecoration removeListener screenToTextCoordinates scrollBy scrollCursorIntoView scrollSelectionIntoView scrollTo scrollToLine scrollToRow scrollToX scrollToY setAnimatedScroll setAnnotations setCompositionText setCursorStyle setDefaultHandler setDisplayIndentGuides setFadeFoldWidgets setGhostText setHighlightGutterLine setHighlightIndentGuides setHScrollBarAlwaysVisible setMargin setMouseCursor setOption setOptions 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

    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
    destroyed?: boolean
    enableKeyboardAccessibility?: boolean
    gutterWidth: any
    keyboardFocusClassName?: string
    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
    showInvisibles?: boolean
    STEPS: number
    textarea: HTMLTextAreaElement
    theme?: any

    Methods

    • 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 whether an animated scroll happens or not.

      Returns boolean

    • 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

    • {:EditSession.getScrollLeft}

      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

    • Parameters

      • Optionalname: string

      Returns void

    • Parameters

      • name: string
      • callback: Function

      Returns void

    • 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

      • name: string
      • callback: Function

      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

    • Parameters

      • optList: Partial<T>

      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

    • 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

    • Schedules an update to all the back markers in the document.

      Returns void

    • Schedules an update to all the front markers in the document.

      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