Represents a selection in the TextEditor.
This section only has Extended methods.
Calls your callback
when the selection was moved.
Argument | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Selection that triggered the event |
Return values |
---|
Returns a Disposable on which |
Calls your callback
when the selection was destroyed
Argument | Description |
---|---|
|
Return values |
---|
Returns a Disposable on which |
Modifies the screen range for the selection.
Argument | Description |
---|---|
|
The new Range to use. |
|
optional
Object options matching those found in ::setBufferRange. |
Modifies the buffer Range for the selection.
Argument | Description |
---|---|
|
The new Range to select. |
|
optional
Object with the keys: |
|
Boolean indicating whether to set the selection in a reversed orientation. |
|
if |
|
Boolean indicating whether to autoscroll to the new range. Defaults to |
Determines if the selection contains anything.
Determines if the ending position of a marker is greater than the starting position.
This can happen when, for example, you highlight text “up” in a TextBuffer.
Return values |
---|
Returns whether the selection is a single line or not. |
Return values |
---|
Returns the text in the selection. |
Selects the text from the current cursor position to a given screen position.
Argument | Description |
---|---|
|
An instance of Point, with a given |
Selects the text from the current cursor position to a given buffer position.
Argument | Description |
---|---|
|
An instance of Point, with a given |
Selects the text one position right of the cursor.
Argument | Description |
---|---|
|
optional
Number number of columns to select (default: 1) |
Selects the text one position left of the cursor.
Argument | Description |
---|---|
|
optional
Number number of columns to select (default: 1) |
Selects all the text one position above the cursor.
Argument | Description |
---|---|
|
optional
Number number of rows to select (default: 1) |
Selects all the text one position below the cursor.
Argument | Description |
---|---|
|
optional
Number number of rows to select (default: 1) |
Selects all the text from the current cursor position to the top of the buffer.
Selects all the text from the current cursor position to the bottom of the buffer.
Selects all the text in the buffer.
Selects all the text from the current cursor position to the beginning of the line.
Selects all the text from the current cursor position to the first character of the line.
Selects all the text from the current cursor position to the end of the screen line.
Selects all the text from the current cursor position to the end of the buffer line.
Selects all the text from the current cursor position to the beginning of the word.
Selects all the text from the current cursor position to the end of the word.
Selects all the text from the current cursor position to the beginning of the next word.
Selects text to the previous word boundary.
Selects text to the next word boundary.
Selects text to the previous subword boundary.
Selects text to the next subword boundary.
Selects all the text from the current cursor position to the beginning of the next paragraph.
Selects all the text from the current cursor position to the beginning of the previous paragraph.
Expands the newest selection to include the entire word on which the cursors rests.
Selects an entire line in the buffer.
Argument | Description |
---|---|
|
The line Number to select (default: the row of the cursor). |
Expands the newest selection to include the entire line on which the cursor currently rests.
It also includes the newline character.
Replaces text at the current selection.
Argument | Description |
---|---|
|
A String representing the text to add |
|
optional
Object with keys: |
|
If |
|
If |
|
If |
|
If |
|
By default, when pasting multiple lines, Atom attempts to preserve the relative indent level between the first line and trailing lines, even if the indent level of the first line has changed from the copied text. If this option is |
|
optional
Boolean (default: true) |
|
Deprecated If |
|
optional
Boolean Must be |
If the selection is empty, removes all text from the cursor to the end of the line. If the cursor is already at the end of the line, it removes the following newline. If the selection isn’t empty, only deletes the contents of the selection.
Argument | Description |
---|---|
|
optional |
|
optional
Boolean Must be |
Removes the line at the beginning of the selection if the selection is empty unless the selection spans multiple lines in which case all lines are removed.
Argument | Description |
---|---|
|
optional |
|
optional
Boolean Must be |
Joins the current line with the one below it. Lines will be separated by a single space.
If there selection spans more than one line, all the lines are joined together.
Argument | Description |
---|---|
|
optional |
|
optional
Boolean Must be |
Copies the current selection to the clipboard.
Argument | Description |
---|---|
|
Boolean if |
|
Boolean if |
Creates a fold containing the current selection.
Moves the selection down one row.
Moves the selection up one row.
Combines the given selection into this selection and then destroys the given selection.
Argument | Description |
---|---|
|
A Selection to merge with. |
|
optional
Object options matching those found in ::setBufferRange. |
Compare this selection’s buffer range to another selection’s buffer range.
See Range::compare for more details.
Argument | Description |
---|---|
|
A Selection to compare against |