Sets up a new EditSession
and associates it with the given Document
and TextMode
.
Sets up a new EditSession
and associates it with the given Document
and TextMode
.
text | Document | String | Required. If |
mode | TextMode | Required. The initial language mode to use for the document |
Emitted when an annotation changes, like through EditSession.setAnnotations()
.
Emitted when an annotation changes, like through EditSession.setAnnotations()
.
Emitted when a back marker changes.
Emitted when a back marker changes.
Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.
Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.
Emitted when a code fold is added or removed.
Emitted when a code fold is added or removed.
Emitted when a front marker changes.
Emitted when a front marker changes.
Emitted when the current mode changes.
Emitted when the current mode changes.
Emitted when the ability to overwrite text changes, via EditSession.setOverwrite()
.
Emitted when the ability to overwrite text changes, via EditSession.setOverwrite()
.
Emitted when the tab size changes, via EditSession.setTabSize()
.
Emitted when the tab size changes, via EditSession.setTabSize()
.
Emitted when the wrapping limit changes.
Emitted when the wrapping limit changes.
Emitted when the wrap mode changes.
Emitted when the wrap mode changes.
Emitted when a background tokenizer asynchronously processes new rows.
Emitted when a background tokenizer asynchronously processes new rows.
e | Object | Required. An object containing one property, |
Adds a new marker to the given Range
. If inFront
is true
, a front marker is defined, and the 'changeFrontMarker'
event fires; otherwise, the 'changeBackMarker'
event fires.
Adds a new marker to the given Range
. If inFront
is true
, a front marker is defined, and the 'changeFrontMarker'
event fires; otherwise, the 'changeBackMarker'
event fires.
range | Range | Required. Define the range of the marker |
clazz | String | Required. Set the CSS class for the marker |
type | Function | String | Required. Identify the type of the marker |
inFront | Boolean | Required. Set to |
Clears all the annotations for this session. This function also triggers the 'changeAnnotation'
event.
Clears all the annotations for this session. This function also triggers the 'changeAnnotation'
event.
Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint'
event.
Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint'
event.
Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.
Returns the annotations for the EditSession
.
Returns the annotations for the EditSession
.
Returns an array of numbers, indicating which rows have breakpoints.
Returns an array of numbers, indicating which rows have breakpoints.
Returns the Document
associated with this session.
Returns the Document
associated with this session.
Returns the number of rows in the document.
Returns the number of rows in the document.
Returns an array of strings of the rows between firstRow
and lastRow
. This function is inclusive of lastRow
.
Returns an array containing the IDs of all the markers, either front or back.
Returns an array containing the IDs of all the markers, either front or back.
inFront | Boolean | Required. If |
Returns the current text mode.
Returns the current text mode.
Returns the current new line mode.
Returns the current new line mode.
Returns true
if overwrites are enabled; false
otherwise.
Returns true
if overwrites are enabled; false
otherwise.
Returns the length of the screen.
Returns the length of the screen.
Returns the width of the screen.
Returns the width of the screen.
Returns the value of the distance between the left of the editor and the leftmost part of the visible content.
Returns the value of the distance between the left of the editor and the leftmost part of the visible content.
Returns the value of the distance between the top of the editor and the topmost part of the visible content.
Returns the value of the distance between the top of the editor and the topmost part of the visible content.
Returns selection object.
Returns selection object.
Returns the current tab size.
Returns the current tab size.
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()
); otherwise it's simply '\t'
.
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()
); otherwise it's simply '\t'
.
Given a range within the document, this function returns all the text within that range as a single string.
Given a range within the document, this function returns all the text within that range as a single string.
range | Range | Required. The range to work with |
Returns an object indicating the token at the current row. The object has two properties: index
and start
.
Returns the current undo manager.
Returns the current undo manager.
Returns true
if soft tabs are being used, false
otherwise.
Returns true
if soft tabs are being used, false
otherwise.
Returns true
if workers are being used.
Returns true
if workers are being used.
Returns true
if wrap mode is being used; false
otherwise.
Returns true
if wrap mode is being used; false
otherwise.
Returns the value of wrap limit.
Returns the value of wrap limit.
Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:
Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:
{ min: wrapLimitRange_min, max: wrapLimitRange_max }
Indents all the rows, from startRow
to endRow
(inclusive), by prefixing each row with the token in indentString
.
Indents all the rows, from startRow
to endRow
(inclusive), by prefixing each row with the token in indentString
.
If indentString
contains the '\t'
character, it's replaced by whatever is defined by getTabString()
.
startRow | Number | Required. Starting row |
endRow | Number | Required. Ending row |
indentString | String | Required. The indent token |
Moves a range of text from the given range to the given position. toPosition
is an object that looks like this:
{ row: newRowLocation, column: newColumnLocation }
Moves a range of text from the given range to the given position. toPosition
is an object that looks like this:
{ row: newRowLocation, column: newColumnLocation }
fromRange | Range | Required. The range of text you want moved within the document |
toPosition | Object | Required. The location (row and column) where you want to move the text to |
Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start ()
to all the rows; it also emits the 'tokenizerUpdate'
event.
Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start ()
to all the rows; it also emits the 'tokenizerUpdate'
event.
e | Object | Required. |
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker'
event is emitted. If the marker was in the back, the 'changeBackMarker'
event is emitted.
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker'
event is emitted. If the marker was in the back, the 'changeBackMarker'
event is emitted.
markerId | Number | Required. A number representing a marker |
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
screenRow | Number | Required. The screen row to check |
screenColumn | Number | Required. The screen column to check |
Sets a breakpoint on the row number given by rows
. This function also emites the 'changeBreakpoint'
event.
Sets a breakpoint on every row number given by rows
. This function also emites the 'changeBreakpoint'
event.
Sets a breakpoint on every row number given by rows
. This function also emites the 'changeBreakpoint'
event.
rows | Array | Required. An array of row indices |
Sets the EditSession
to point to a new Document
. If a BackgroundTokenizer
exists, it also points to doc
.
Sets the EditSession
to point to a new Document
. If a BackgroundTokenizer
exists, it also points to doc
.
doc | Document | Required. The new |
Pass in true
to enable overwrites in your session, or false
to disable.
Pass in true
to enable overwrites in your session, or false
to disable.
If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite
changes, this function also emits the changeOverwrite
event.
overwrite | Boolean | Required. Defines wheter or not to set overwrites |
Set the number of spaces that define a soft tab; for example, passing in 4
transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize
event.
Set the number of spaces that define a soft tab; for example, passing in 4
transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize
event.
tabSize | Number | Required. The new tab size |
Sets the undo manager.
Pass true
to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t'
).
Pass true
to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t'
).
useSoftTabs | Boolean | Required. Value indicating whether or not to use soft tabs |
Sets whether or not line wrapping is enabled. If useWrapMode
is different than the current value, the 'changeWrapMode'
event is emitted.
Sets whether or not line wrapping is enabled. If useWrapMode
is different than the current value, the 'changeWrapMode'
event is emitted.
useWrapMode | Boolean | Required. Enable (or disable) wrap mode |
Sets the boundaries of wrap. Either value can be null
to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min
or max
are different, this method also emits the 'changeWrapMode'
event.
Sets the boundaries of wrap. Either value can be null
to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min
or max
are different, this method also emits the 'changeWrapMode'
event.
min | Number | Required. The minimum wrap value (the left side wrap) |
max | Number | Required. The maximum wrap value (the right side wrap) |
Sets the value of overwrite to the opposite of whatever it currently is.
Sets the value of overwrite to the opposite of whatever it currently is.