EditSession[edit]
Constructors
Sets up a new EditSession and associates it with the given Document and TextMode.
Events
- EditSession.on("change", function(e))
Emitted when the document changes.
- EditSession.on("changeFold", function(e))
Emitted when a code fold added or removed.
- EditSession.on("changeScrollLeft", function())
Emitted when the scroll left changes.
- EditSession.on("changeScrollTop", function())
Emitted when the scroll top changes.
- EditSession.on("tokenizerUpdate", function(e))
Emitted when a background tokenizer asynchronousely processes new rows.
Methods
- EditSession.$computeWrapSplits(tokens, wrapLimit)
- EditSession.$constrainWrapLimit(wrapLimit)
- EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange)
- EditSession.$startWorker()
- EditSession.$syncInformUndoManager()
- EditSession.$updateInternalDataOnChange()
- EditSession.$updateWrapData(firstRow, lastRow)
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.
- EditSession.clearAnnotations()
Clears all the annotations for this session. This function also triggers the 'changeAnnotation' event.
- EditSession.clearBreakpoints()
Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint' event.
- EditSession.documentToScreenColumn(row, docColumn)
- EditSession.documentToScreenRow(docRow, docColumn)
- EditSession.getAnnotations()
Returns the annotations for the EditSession.
- EditSession.getBreakpoints()
Returns an array of numbers, indicating which rows have breakpoints.
- EditSession.getDocument()
Returns the Document associated with this session.
- EditSession.getDocumentLastRowColumnPosition(docRow, docColumn)
- EditSession.getLength()
Returns the number of rows in the document.
- EditSession.getMode()
Returns the current text mode.
- EditSession.getNewLineMode()
Returns the current new line mode.
- EditSession.getOverwrite()
Returns true if overwrites are enabled; false otherwise.
- EditSession.getRowSplitData(row)
- undefined
- String
- EditSession.getScreenLength()
Returns the length of the screen.
- EditSession.getScreenWidth()
Returns the width of the screen.
- EditSession.getScrollLeft()
Returns the value of the distance between the left of the editor and the leftmost part of the visible content.
- EditSession.getScrollTop()
Returns the value of the distance between the top of the editor and the topmost part of the visible content.
- EditSession.getSelection()
Returns the string of the current selection.
- EditSession.getTabSize()
Returns the current tab size.
- EditSession.getTabString()
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'.
- EditSession.getUndoManager()
Returns the current undo manager.
- EditSession.getUseSoftTabs()
Returns true if soft tabs are being used, false otherwise.
- EditSession.getUseWorker()
Returns true if workers are being used.
- EditSession.getUseWrapMode()
Returns true if wrap mode is being used; false otherwise.
- EditSession.getWrapLimit()
Returns the value of wrap limit.
- EditSession.getWrapLimitRange()
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.
If indentString contains the '\t' character, it's replaced by whatever is defined by getTabString.
Arguments
| startRow | Number | Required. Starting row |
| endRow | Number | Required. Ending row |
| indentString | String | Required. The indent token |
- EditSession.onReloadTokenizer(e)
Reloads all the tokens on the current session. This function calls start to all the rows; it also emits the 'tokenizerUpdate' event.
- EditSession.screenToDocumentColumn(screenRow, screenColumn)
- EditSession.screenToDocumentRow(screenRow, screenColumn)
- EditSession.setMode(TextMode mode)
Sets a new text mode for the EditSession. This method also emits the 'changeMode' event. If a BackgroundTokenizer is set, the 'tokenizerUpdate' event is also emitted.
Arguments
| mode | TextMode | Required. Set a new text mode |
- EditSession.setOverwrite(Boolean overwrite)
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 emites the changeOverwrite event.
Arguments
| overwrite | Boolean | Required. Defines wheter or not to set overwrites |
- EditSession.setScrollLeft(scrollLeft)
Sets the value of the distance between the left of the editor and the leftmost part of the visible content.
- EditSession.setUndoManager(UndoManager undoManager)
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.
- EditSession.stopWorker()
- EditSession.toggleOverwrite()
Sets the value of overwrite to the opposite of whatever it currently is.