Creates a new Selection
object.
The session to use
Emitted when the cursor selection changes.
Emitted when the cursor position changes.
Adds a range to a selection by entering multiselect mode, if necessary.
The new range to add
[Empties the selection (by de-selecting it). This function also emits the 'changeSelection'
event.]{: #Selection.clearSelection}
remove listeners from document
Returns a concatenation of all the ranges.
Returns an object containing the row
and column
of the calling selection anchor.
Returns an object containing the row
and column
current position of the cursor.
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.
Returns an object containing the row
and column
of the calling selection anchor.
Returns an object containing the row
and column
of the calling selection lead.
Moves the selection to highlight the entire word.
Returns true
if the selection is going backwards in the document.
Returns true
if the selection is empty.
Returns true
if the selection is a multi-line.
Merges overlapping ranges ensuring consistency after changes
Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.
The number of rows to move by
The number of characters to move by
Moves the cursor down one row.
Moves the cursor to the end of the file.
Moves the cursor to the start of the file.
Moves the cursor left one column.
Moves the cursor to the end of the line.
Moves the cursor to the start of the line.
Moves the cursor to the word on the left.
Moves the cursor to the word on the right.
Moves the cursor right one column.
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}
The row to move to
The column to move to
{: #preventUpdateBool}
Moves the selection to the position indicated by its row
and column
.
The position to move to
Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc}
The row to move to
The column to move to
Moves the cursor up one row.
Moves the selection cursor to the indicated row and column.
The row to select to
The column to select to
Moves the selection cursor to the row and column indicated by pos
.
An object containing the row and column
Selects a word, including its right whitespace.
Selects all the text in the document.
Moves the selection down one row.
Moves the selection to the end of the file.
Moves the selection to the start of the file.
Moves the selection left one column.
Selects the entire line.
Moves the selection to the end of the current line.
Moves the selection to the beginning of the current line.
Moves the selection right one column.
Moves the selection cursor to the indicated row and column.
The row to select to
The column to select to
Moves the selection cursor to the row and column indicated by pos
.
An object containing the row and column
Moves the selection up one row.
Selects an entire word boundary.
Moves the selection to the first word on the left.
Moves the selection to the first word on the right.
Sets the selection to the provided range.
The range of text to select
Indicates if the range should go backwards (true
) or not
Sets the row and column position of the anchor. This function also emits the 'changeSelection'
event.
The new row
The new column
Sets the selection to the provided range.
Splits all the ranges into lines.
Removes a Range containing pos (if it exists).
The position to remove, as a {row, column}
object
Returns true
if moving the character next to the cursor in the specified direction is a soft tab.
the current cursor position
the tab size
1 for right, -1 for left
Generated using TypeDoc
Contains the cursor position and the text selection of an edit session.
The row/columns used in the selection are in document coordinates representing the coordinates as they appear in the document before applying soft wrap and folding.