Hierarchy (View Summary)

Constructors

Properties

_eventRegistry?: any
anchor: Anchor
cursor: Anchor
getSelectionAnchor: () => Point

Left for backward compatibility

index?: number
inMultiSelectMode: boolean
lead: Anchor
rangeCount: number
rangeList: RangeList
ranges: Range[]
session: EditSession
setSelectionAnchor: (row: number, column: number) => void

Left for backward compatibility

setSelectionRange: (range: IRange, reverse?: boolean) => void

Methods

  • Adds a range to a selection by entering multiselect mode, if necessary.

    Parameters

    • range: Range

      The new range to add

    • Optional$blockChangeEvents: boolean

      Whether or not to block changing events

    Returns any

  • [Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.]{: #Selection.clearSelection}

    Returns void

  • Parameters

    • range: Range & { desiredColumn?: number }

    Returns void

  • Returns an object containing the row and column of the calling selection anchor.

    Returns Point

  • Saves the current cursor position and calls func that can change the cursor postion. The result is the range of the starting and eventual cursor position. Will reset the cursor position.

    Parameters

    • func: Function

      The callback that should change the cursor position

    Returns Range

  • Returns an object containing the row and column of the calling selection lead.

    Returns any

  • Moves the selection to highlight the entire word.

    Parameters

    • row: any
    • column: any

    Returns Range

  • Returns true if the selection is going backwards in the document.

    Returns boolean

  • Returns true if the selection is empty.

    Returns boolean

  • Parameters

    • data: any

    Returns boolean

  • Returns true if the selection is a multi-line.

    Returns boolean

  • Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.

    Parameters

    • rows: number

      The number of rows to move by

    • chars: number

      The number of characters to move by

    Returns void

  • Moves the cursor to the end of the file.

    Returns void

  • Moves the cursor to the start of the file.

    Returns void

  • Moves the cursor to the end of the line.

    Returns void

  • Moves the cursor to the start of the line.

    Returns void

  • Moves the cursor to the word on the left.

    Returns void

  • Moves the cursor to the word on the right.

    Returns void

  • Moves the cursor right one column.

    Returns void

  • Moves the cursor to the row and column provided. [If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc}

    Parameters

    • row: number

      The row to move to

    • column: number

      The column to move to

    • OptionalkeepDesiredColumn: boolean

    Returns void

  • Moves the selection to the position indicated by its row and column.

    Parameters

    • position: Point

      The position to move to

    Returns void

  • Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc}

    Parameters

    • row: number

      The row to move to

    • column: number

      The column to move to

    • keepDesiredColumn: boolean

    Returns void

  • Moves the selection cursor to the indicated row and column.

    Parameters

    • row: number

      The row to select to

    • column: number

      The column to select to

    Returns void

  • Moves the selection cursor to the row and column indicated by pos.

    Parameters

    • pos: any

      An object containing the row and column

    Returns void

  • Selects all the text in the document.

    Returns void

  • Selects a word, including its right whitespace.

    Returns void

  • Moves the selection to the end of the file.

    Returns void

  • Moves the selection to the start of the file.

    Returns void

  • Moves the selection to the end of the current line.

    Returns void

  • Moves the selection to the beginning of the current line.

    Returns void

  • Moves the selection right one column.

    Returns void

  • Moves the selection cursor to the indicated row and column.

    Parameters

    • row: number

      The row to select to

    • column: number

      The column to select to

    Returns void

  • Moves the selection cursor to the row and column indicated by pos.

    Parameters

    • pos: Point

      An object containing the row and column

    Returns void

  • Moves the selection to the first word on the left.

    Returns void

  • Moves the selection to the first word on the right.

    Returns void

  • Sets the row and column position of the anchor. This function also emits the 'changeSelection' event.

    Parameters

    • row: number

      The new row

    • column: number

      The new column

    Returns void

  • Sets the selection to the provided range.

    Parameters

    • range: IRange

      The range of text to select

    • Optionalreverse: boolean

      Indicates if the range should go backwards (true) or not

    Returns void

  • Parameters

    • Optionalrange: Range & { desiredColumn?: number }

    Returns Range & { desiredColumn?: number }

  • Returns true if moving the character next to the cursor in the specified direction is a soft tab.

    Parameters

    • cursor: Point

      the current cursor position

    • tabSize: number

      the tab size

    • direction: number

      1 for right, -1 for left

    Returns boolean