The main class required to set up an Ace instance in the browser.
-diff --git a/api/ace.html b/api/ace.html deleted file mode 100644 index 787a8efb..00000000 --- a/api/ace.html +++ /dev/null @@ -1,5 +0,0 @@ -
The main class required to set up an Ace instance in the browser.
-This method embeds the Ace editor into the DOM, at the element provided by el.
This method embeds the Ace editor into the DOM, at the element provided by el.
| el | String | DOMElement | Required. Either the id of an element, or the element itself - |
Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated
-Fires whenever the anchor position changes.
-Fires whenever the anchor position changes.
-Events that can trigger this function include setPosition().
| e | Object | Required. An object containing information about the anchor position. It has two properties: -
|
When called, the 'change' event listener is removed.
When called, the 'change' event listener is removed.
Returns the current document.
-Returns the current document.
-Returns an object identifying the row and column position of the current anchor.
Returns an object identifying the row and column position of the current anchor.
Sets the anchor position to the specified row and column. If noClip is true, the position is not clipped.
Sets the anchor position to the specified row and column. If noClip is true, the position is not clipped.
| row | Number | Required. The row index to move the anchor to - |
| column | Number | Required. The column index to move the anchor to - |
| noClip | Boolean | Required. Identifies if you want the position to be clipped - |
Tokenizes the current Document in the background, and caches the tokenized rows for future use. If a certain row is changed, everything below that row is re-tokenized.
Fires whenever the background tokeniziers between a range of rows are going to be updated.
-Fires whenever the background tokeniziers between a range of rows are going to be updated.
-| e | Object | Required. An object containing two properties, |
Emits the 'update' event. firstRow and lastRow are used to define the boundaries of the region to be updated.
Stops tokenizing.
-Stops tokenizing.
-Contains the text of the document. Document can be attached to several EditSessions. At its core, Documents are just an array of strings, with each row in the document matching up to the array index.
Fires whenever the document changes.
-Fires whenever the document changes.
-Several methods trigger different "change" events. Below is a list of each action type, followed by each property that's also available:
"insertLines" (emitted by Document.insertLines())range: the Range of the change within the documentlines: the lines in the document that are changing"insertText" (emitted by Document.insertNewLine())range: the Range of the change within the documenttext: the text that's being added"removeLines" (emitted by Document.insertLines())range: the Range of the change within the documentlines: the lines in the document that were removednl: the new line character (as defined by Document.getNewLineCharacter())"removeText" (emitted by Document.removeInLine() and Document.removeNewLine())range: the Range of the change within the documenttext: the text that's being removed| e | Object | Required. Contains at least one property called |
Splits a string of text on any newline (\n) or carriage-return ('\r') characters.
Applies all the changes previously accumulated. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.
Applies all the changes previously accumulated. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.
Returns all lines in the document as string array. Warning: The caller should not modify this array!
-Returns all lines in the document as string array. Warning: The caller should not modify this array!
-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 the newline character that's being used, depending on the value of newLineMode.
Returns the newline character that's being used, depending on the value of newLineMode.
| String | If
|
Returns the type of newlines being used; either windows, unix, or auto
Returns the type of newlines being used; either windows, unix, or auto
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 all the lines in the document as a single string, split by the new line character.
-Returns all the lines in the document as a single string, split by the new line character.
-Inserts text into the position at the current row. This method also triggers the 'change' event.
Inserts text into the position at the current row. This method also triggers the 'change' event.
| position | Number | Required. The position to insert at - |
| text | String | Required. A chunk of text - |
| Object | Returns an object containing the final row and column, like this:
|
| Number | If |
Inserts the elements in lines into the document, starting at the row index given by row. This method also triggers the 'change' event.
Inserts the elements in lines into the document, starting at the row index given by row. This method also triggers the 'change' event.
| row | Number | Required. The index of the row to insert at - |
| lines | Array | Required. An array of strings - |
| Object | Returns an object containing the final row and column, like this:
|
Inserts a new line into the document at the current row's position. This method also triggers the 'change' event.
Removes the range from the document.
Removes the specified columns from the row. This method also triggers the 'change' event.
Removes the specified columns from the row. This method also triggers the 'change' event.
| row | Number | Required. The row to remove from - |
| startColumn | Number | Required. The column to start removing at - |
| endColumn | Number | Required. The column to stop removing at - |
| Object | Returns an object containing |
Removes a range of full lines. This method also triggers the 'change' event.
Removes the new line between row and the row immediately following it. This method also triggers the 'change' event.
Removes the new line between row and the row immediately following it. This method also triggers the 'change' event.
| row | Number | Required. The row to check - |
Replaces a range in the document with the new text.
Replaces a range in the document with the new text.
| range | Range | Required. A specified Range to replace - |
| text | String | Required. The new text to use as a replacement - |
| Object | Returns an object containing the final row and column, like this: -
|
Reverts any changes previously applied. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.
Reverts any changes previously applied. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.
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 inital 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, |
If text contains either the newline (\n) or carriage-return ('\r') characters, $autoNewLine stores that value.
If text contains either the newline (\n) or carriage-return ('\r') characters, $autoNewLine stores that value.
| text | String | Required. A block of text - |
Calculates the width of the string str on the screen while assuming that the string starts at the first column on the screen.
Calculates the width of the string str on the screen while assuming that the string starts at the first column on the screen.
| str | String | Required. The string to calculate the screen width of - |
| maxScreenColumn | Number | Required. - |
| screenColumn | Number | Required. - |
| Array of Numbers | Returns an
|
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 a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.
Removes a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.
| row | Number | Required. A row index - |
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.
-Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.
-| docRow | Number | Required. The document row to check - |
| docColumn | Number | Required. The document column to check - |
| Object | The object returned by this method has two properties: |
Duplicates all the text between firstRow and lastRow.
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 the string of the current selection.
-Returns the string of the current selection.
-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 - |
Inserts a block of text and the indicated position.
Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.
Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.
| firstRow | Number | Required. The starting row to move up - |
| lastRow | Number | Required. The final row to move up - |
| Number | If |
{ row: newRowLocation, column: newColumnLocation }
-{ 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 - |
| Range | The new range where the text was moved 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.
Removes the range from the document.
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 - |
Replaces a range in the document with the new text.
Replaces a range in the document with the new text.
| range | Range | Required. A specified Range to replace - |
| text | String | Required. The new text to use as a replacement - |
| Object | Returns an object containing the final row and column, like this:
|
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 - |
| Object | The object returned has two properties: |
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 indicies - |
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 |
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.
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.
| mode | TextMode | Required. Set a new text mode - |
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 emites the changeOverwrite event.
| overwrite | Boolean | Required. Defines wheter or not to set overwrites - |
Sets the value of the distance between the left of the editor and the leftmost part of the visible content.
-Sets the value of the distance between the left of the editor and the leftmost part of the visible content.
-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.
-The main entry point into the Ace functionality. The Editor manages the EditSession (which manages Documents), as well as the VirtualRenderer, which draws everything to the screen. Event sessions dealing with the mouse and keyboard are bubbled up from Document to the Editor, which decides what to do with them.
Creates a new Editor object.
Creates a new Editor object.
| renderer | VirtualRenderer | Required. Associated |
| session | EditSession | Required. The |
Emitted once the editor has been blurred.
-Emitted once the editor has been blurred.
-Emitted when the selection changes.
-Emitted when the selection changes.
-Emitted when the selection style changes, via Editor.setSelectionStyle().
Emitted when the selection style changes, via Editor.setSelectionStyle().
| data | Object | Required. Contains one property, |
Emitted whenever the EditSession changes.
Emitted whenever the EditSession changes.
| e | Object | Required. An object with two properties, |
Emitted once the editor comes into focus.
-Emitted once the editor comes into focus.
-Returns an object indicating the currently selected rows. The object looks like this:
-Returns an object indicating the currently selected rows. The object looks like this:
-{ first: range.start.row, last: range.end.row }
-Returns the number of currently visibile rows.
-Returns the number of currently visibile rows.
-Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.
-Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.
-| mover | Function | Required. A method to call on each selected row - |
aligns cursors or selected text
-aligns cursors or selected text
-Outdents the current line.
-Outdents the current line.
-Blurs the current textInput.
Blurs the current textInput.
Attempts to center the current selection on the screen.
-Attempts to center the current selection on the screen.
-Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.
Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.
Cleans up the entire editor.
-Cleans up the entire editor.
-Removes all the selections except the last added one.
-Removes all the selections except the last added one.
-Attempts to find needle within the document. For more information on options, see Search.
Brings the current textInput into focus.
Brings the current textInput into focus.
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Returns the string of text currently highlighted.
-Returns the string of text currently highlighted.
-Returns the screen position of the cursor.
-Returns the screen position of the cursor.
-Returns the current mouse drag delay.
-Returns the current mouse drag delay.
-Returns the index of the first visible row.
-Returns the index of the first visible row.
-Returns true if current lines are always highlighted.
Returns true if current lines are always highlighted.
Returns true if currently highlighted words are to be highlighted.
Returns true if currently highlighted words are to be highlighted.
Returns the keyboard handler.
-Returns the keyboard handler.
-Returns the index of the last visible row.
-Returns the index of the last visible row.
-Returns true if overwrites are enabled; false otherwise.
Returns true if overwrites are enabled; false otherwise.
Returns the column number of where the print margin is.
-Returns the column number of where the print margin is.
-Returns true if the editor is set to read-only mode.
Returns true if the editor is set to read-only mode.
Returns the value indicating how fast the mouse scroll speed is.
-Returns the value indicating how fast the mouse scroll speed is.
-Returns the currently highlighted selection.
-Returns the currently highlighted selection.
-Returns the current selection style.
-Returns the current selection style.
-Returns the current session being used.
-Returns the current session being used.
-Returns true if the fold widgets are shown.
Returns true if the fold widgets are shown.
Returns true if invisible characters are being shown.
Returns true if invisible characters are being shown.
Returns true if the print margin is being shown.
Returns true if the print margin is being shown.
Returns the path of the current theme.
-Returns the path of the current theme.
-Returns the current session's content.
-Returns the current session's content.
-Moves the cursor to the specified line number, and also into the indiciated column.
-Shifts the document to wherever "page down" is, as well as moving the cursor position.
-Shifts the document to wherever "page down" is, as well as moving the cursor position.
-Shifts the document to wherever "page up" is, as well as moving the cursor position.
-Shifts the document to wherever "page up" is, as well as moving the cursor position.
-Indents the current line.
-Indents the current line.
-Returns true if the current textInput is in focus.
Returns true if the current textInput is in focus.
Moves the cursor's row and column to the next matching bracket.
-Moves the cursor's row and column to the next matching bracket.
-Moves the cursor to the specified row and column. Note that this does not de-select the current selection.
-Moves a range of text from the given range to the given position. toPosition is an object that looks like this:
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 - |
| Range | The new range where the text was moved to. - |
Moves the cursor to the end of the current file. Note that this does de-select the current selection.
-Moves the cursor to the start of the current file. Note that this does de-select the current selection.
-Moves the cursor to the end of the current line. Note that this does de-select the current selection.
-Moves the cursor to the start of the current line. Note that this does de-select the current selection.
-Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.
-Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.
-Called whenever a text "copy" happens.
-Called whenever a text "copy" happens.
-called whenever a text "cut" happens.
-called whenever a text "cut" happens.
-Perform a redo operation on the document, reimplementing the last change.
-Perform a redo operation on the document, reimplementing the last change.
-Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.
-Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.
-| dir | String | Required. The direction of the deletion to occur, either "left" or "right" - |
Removes all the lines in the current selection
-Removes all the lines in the current selection
-Removes the selection marker.
-Removes the selection marker.
-| range | Range | Required. The selection range added with |
Removes all the words to the right of the current selection, until the end of the line.
-Removes all the words to the right of the current selection, until the end of the line.
-Removes all the words to the left of the current selection, until the start of the line.
-Removes all the words to the left of the current selection, until the start of the line.
-Removes the word directly to the left of the current selection.
-Removes the word directly to the left of the current selection.
-Removes the word directly to the right of the current selection.
-Removes the word directly to the right of the current selection.
-Scrolls the document to wherever "page down" is, without changing the cursor position.
-Scrolls the document to wherever "page down" is, without changing the cursor position.
-Scrolls the document to wherever "page up" is, without changing the cursor position.
-Scrolls the document to wherever "page up" is, without changing the cursor position.
-TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to)
-TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to)
-| line | Number | Required. The line to scroll to - |
| center | Boolean | Required. If |
| animate | Boolean | Required. If |
| callback | Function | Required. Function to be called when the animation has finished - |
Selects all the text in editor.
-Selects all the text in editor.
-Finds the next occurence of text in an active selection and adds it to the selections.
-Selects the text from the current position of the document until where a "page down" finishes.
-Selects the text from the current position of the document until where a "page down" finishes.
-Selects the text from the current position of the document until where a "page up" finishes.
-Selects the text from the current position of the document until where a "page up" finishes.
-Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
-Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
-| enabled | Boolean | Required. Enables or disables behaviors - |
Sets a new keyboard handler.
-Sets a new keyboard handler.
-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.
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.
| overwrite | Boolean | Required. Defines wheter or not to set overwrites - |
If readOnly is true, then the editor is set to read-only mode, and none of the content can change.
If readOnly is true, then the editor is set to read-only mode, and none of the content can change.
| readOnly | Boolean | Required. Specifies whether the editor can be modified or not - |
Indicates how selections should occur. By default, selections are set to "line". This function also emits the 'changeSelectionStyle' event.
Indicates how selections should occur. By default, selections are set to "line". This function also emits the 'changeSelectionStyle' event.
| style | String | Required. The new selection style - |
Sets a new editsession to use. This method also emits the 'changeSession' event.
Sets a new editsession to use. This method also emits the 'changeSession' event.
| session | EditSession | Required. The new session to use - |
If showInvisibiles is set to true, invisible characters—like spaces or new lines—are show in the editor.
If showInvisibiles is set to true, invisible characters—like spaces or new lines—are show in the editor.
| showInvisibles | Boolean | Required. Specifies whether or not to show invisible characters - |
Splits the line at the current selection (by inserting an '\n').
Splits the line at the current selection (by inserting an '\n').
Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).
-Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).
-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.
-Converts the current selection entirely into lowercase.
-Converts the current selection entirely into lowercase.
-Converts the current selection entirely into uppercase.
-Converts the current selection entirely into uppercase.
-Transposes current line.
-Transposes current line.
-Perform an undo operation on the document, reverting the last change. Returns the range of the undo.
-Perform an undo operation on the document, reverting the last change. Returns the range of the undo.
-Removes the class style from the editor.
Removes the class style from the editor.
Updates the cursor and marker layers.
-Updates the cursor and marker layers.
-Welcome to the Ace API Reference Guide. Ace is a standalone code editor written in JavaScript that you can embed onto any website. We're used in a bunch of places already, like GitHub, Google, and Facebook.
-On the left, you'll find a list of all of our currently documented classes. There are plenty more to do, but these represent the "core" set. For more information on how to work with Ace, check out the main Ace website.
-TODO
-Emitted when the cursor changes.
-Emitted when the cursor changes.
-Emitted when the place holder updates.
-Emitted when the place holder updates.
-TODO
-TODO
-TODO
-TODO
-Hides all over markers in the EditSession that are not the currently selected one.
Hides all over markers in the EditSession that are not the currently selected one.
TODO
-TODO
-TODO
-TODO
-This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
-Creates a new Range object with the given starting and ending row and column points.
Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.
Returns a duplicate of the calling range.
-Returns a duplicate of the calling range.
-Returns a range containing the starting and ending rows of the original range, but with a column value of 0.
Returns a range containing the starting and ending rows of the original range, but with a column value of 0.
Checks the row and column points with the row and column points of the calling range.
-Checks the row and column points with the row and column points of the calling range.
-| row | Number | Required. A row point to compare with - |
| column | Number | Required. A column point to compare with - |
| Number | This method returns one of the following numbers:
|
Checks the row and column points with the row and column points of the calling range.
-Checks the row and column points with the row and column points of the calling range.
-| row | Number | Required. A row point to compare with - |
| column | Number | Required. A column point to compare with - |
| Number | This method returns one of the following numbers:
|
Checks the row and column points with the row and column points of the calling range.
-Checks the row and column points with the row and column points of the calling range.
-| row | Number | Required. A row point to compare with - |
| column | Number | Required. A column point to compare with - |
| Number | This method returns one of the following numbers:
|
Checks the row and column points of p with the row and column points of the calling range.
Checks the row and column points of p with the row and column points of the calling range.
| p | Range | Required. A point to compare with - |
| Number | This method returns one of the following numbers:
|
Compares this range (A) with another range (B).
Compares this range (A) with another range (B).
| range | Range | Required. A range to compare with - |
| Number | This method returns one of the following numbers:
|
Checks the row and column points with the row and column points of the calling range.
-Checks the row and column points with the row and column points of the calling range.
-| row | Number | Required. A row point to compare with - |
| column | Number | Required. A column point to compare with - |
| Number | This method returns one of the following numbers:
|
Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:
Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:
this.start.row <= row <= this.end.row && - this.start.column <= column <= this.end.column
-| row | Number | Required. A row to check for - |
| column | Number | Required. A column to check for - |
Checks the start and end points of range and compares them to the calling range. Returns true if the range is contained within the caller's range.
Checks the start and end points of range and compares them to the calling range. Returns true if the range is contained within the caller's range.
| range | Range | Required. A range to compare with - |
Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.
-Returns true if the caller's ending row point is the same as row, and if the caller's ending column is the same as column.
Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.
Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.
| range | Range | Required. A range to check against - |
Returns true if the range spans across multiple lines.
-Returns true if the range spans across multiple lines.
-Returns true if the caller's starting row point is the same as row, and if the caller's starting column is the same as column.
Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.
Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.
| session | EditSession | Required. The |
Returns a string containing the range's row and column information, given like this:
-Returns a string containing the range's row and column information, given like this:
-[start.row/start.column] -> [end.row/end.column]
-| t |
| session | EditSession | Required. The session to search with - |
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
| session | EditSession | Required. The session to search with - |
Searches for all occurances options.needle. If found, this method returns an array of Ranges where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Searches for all occurances options.needle. If found, this method returns an array of Ranges where the text first occurs. If options.backwards is true, the search goes backwards in the session.
| session | EditSession | Required. The session to search with - |
Returns an object containing all the search options.
-Returns an object containing all the search options.
-Searches for options.needle in input, and, if found, replaces it with replacement.
Searches for options.needle in input, and, if found, replaces it with replacement.
| input | String | Required. The text to search in - |
| replacement | String | Required. The replacing text - |
| String | If
|
Contains the cursor position and the text selection of an edit session.
-The row/columns used in the selection are in document coordinates representing ths coordinates as thez appear in the document before applying soft wrap and folding.
-Creates a new Selection object.
Emitted when the cursor position changes.
-Emitted when the cursor position changes.
-Emitted when the cursor selection changes.
-Emitted when the cursor selection changes.
-Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.
Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.
Gets the current position of the cursor.
-Gets the current position of the cursor.
-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 anchor.
Returns an object containing the row and column of the calling selection lead.
Returns an object containing the row and column of the calling selection lead.
Returns true if the selection is going backwards in the document.
Returns true if the selection is going backwards in the document.
Returns true if the selection is empty.
Returns true if the selection is empty.
Returns true if the selection is a multi-line.
Returns true if the selection is a multi-line.
Merges overlapping ranges ensuring consistency after changes
-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.
-Moves the cursor down one row.
-Moves the cursor down one row.
-Moves the cursor to the end of the file.
-Moves the cursor to the end of the file.
-Moves the cursor to the start of the file.
-Moves the cursor to the start of the file.
-Moves the cursor left one column.
-Moves the cursor left one column.
-Moves the cursor to the end of the line.
-Moves the cursor to the end of the line.
-Moves the cursor to the start 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 left.
-Moves the cursor to the word on the right.
-Moves the cursor to the word on the right.
-Moves the cursor right one column.
-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.
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.
| row | Number | Required. The row to move to - |
| column | Number | Required. The column to move to - |
| keepDesiredColumn | Boolean | Required. If |
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
| row | Number | Required. The row to move to - |
| column | Number | Required. The column to move to - |
| keepDesiredColumn | Boolean | Required. If |
Moves the cursor up one row.
-Moves the cursor up one row.
-Gets list of ranges composing rectangular block on the screen
-Selects all the text in the document.
-Selects all the text in the document.
-Selects a word, including its right whitespace.
-Selects a word, including its right whitespace.
-Moves the selection down one row.
-Moves the selection down one row.
-Moves the selection to the end of the file.
-Moves the selection to the end of the file.
-Moves the selection to the start of the file.
-Moves the selection to the start of the file.
-Moves the selection left one column.
-Moves the selection left one column.
-Selects the entire line.
-Selects the entire line.
-Moves the selection to the end of the current line.
-Moves the selection to the end of the current line.
-Moves the selection to the beginning of the current line.
-Moves the selection to the beginning of the current line.
-Moves the selection right one column.
-Moves the selection right one column.
-Moves the selection up one row.
-Moves the selection up one row.
-Moves the selection to highlight the entire word.
-Moves the selection to highlight the entire word.
-Moves the selection to the first word on the left.
-Moves the selection to the first word on the left.
-Moves the selection to the first word on the right.
-Moves the selection to the first word on the right.
-Shifts the selection up (or down, if isBackwards() is true) the given number of columns.
Shifts the selection up (or down, if isBackwards() is true) the given number of columns.
| columns | Number | Required. The number of columns to shift by - |
Blurs the current editor.
-Blurs the current editor.
-Focuses the current editor.
-Focuses the current editor.
-Returns the current editor.
-Returns the current editor.
-Returns the orientation.
-Returns the orientation.
-Returns the number of splits.
-Returns the number of splits.
-Sets a new EditSession for the indicated editor.
Sets a new EditSession for the indicated editor.
| session | EditSession | Required. The new edit session - |
| idx | Number | Required. The editor's index you're interested in - |
This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.
-Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.
-Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.
-| session | EditSession | Required. The session to associate with - |
| initialRow | Number | Required. The row to start the tokenizing at - |
| initialColumn | Number | Required. The column to start the tokenizing at - |
Returns the current tokenized string.
-Returns the current tokenized string.
-Returns the current column.
-Returns the current column.
-Returns the current row.
-Returns the current row.
-Tokenizes all the items from the current point to the row prior in the document.
-Tokenizes all the items from the current point to the row prior in the document.
-| String | If the current point is not at the top of the file, this function returns |
Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.
Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.
This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see the wiki on extending highlighters.
-Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.
Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.
This object maintains the undo stack for an EditSession.
Resets the current undo state and creates a new UndoManager.
Resets the current undo state and creates a new UndoManager.
Returns true if there are redo operations left to perform.
Returns true if there are redo operations left to perform.
Returns true if there are undo operations left to perform.
Returns true if there are undo operations left to perform.
Destroys the stack of undo and redo redo operations.
-Destroys the stack of undo and redo redo operations.
-Perform an undo operation on the document, reverting the last change. Returns the range of the undo.
-Perform an undo operation on the document, reverting the last change. Returns the range of the undo.
-| dontSelect | Boolean | Required. If |
The class that is responsible for drawing everything you see on the screen!
-Constructs a new VirtualRenderer within the container specified, applying the given theme.
Constructs a new VirtualRenderer within the container specified, applying the given theme.
| container | DOMElement | Required. The root element of the editor - |
| theme | String | Required. The starting theme - |
Deprecated; (moved to EditSession)
Deprecated; (moved to EditSession)
Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.
-Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.
-Destroys the text and cursor layers for this renderer.
-Destroys the text and cursor layers for this renderer.
-Returns whether an animated scroll happens or not.
-Returns whether an animated scroll happens or not.
-Returns the root element containing this renderer.
-Returns the root element containing this renderer.
-Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-Returns the index of the first visible row.
-Returns the index of the first visible row.
-Returns whether the horizontal scrollbar is set to be always visible.
-Returns whether the horizontal scrollbar is set to be always visible.
-Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-Returns the index of the last visible row.
-Returns the index of the last visible row.
-Returns the element that the mouse events are attached to
-Returns the element that the mouse events are attached to
-Returns whether the print margin column is being shown or not.
-Returns whether the print margin column is being shown or not.
-Returns the last visible row, regardless of whether it's fully visible or not.
-Returns the last visible row, regardless of whether it's fully visible or not.
-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 the first visible row, regardless of whether it's fully visible or not.
-Returns the first visible row, regardless of whether it's fully visible or not.
-Returns true if the gutter is being shown.
Returns true if the gutter is being shown.
Returns whether invisible characters are being shown or not.
-Returns whether invisible characters are being shown or not.
-Returns whetherthe print margin is being shown or not.
-Returns whetherthe print margin is being shown or not.
-Returns the element to which the hidden text area is added.
-Returns the element to which the hidden text area is added.
-Returns the path of the current theme.
-Returns the path of the current theme.
-Hides the current composition.
-Hides the current composition.
-Hides the cursor icon.
-Hides the cursor icon.
-Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.
Triggers a resize of the editor.
-Triggers a resize of the editor.
-| force | Boolean | Required. If |
| gutterWidth | Number | Required. The width of the gutter in pixels - |
| width | Number | Required. The width of the editor in pixels - |
| height | Number | Required. The hiehgt of the editor, in pixels - |
Deprecated; (moved to EditSession)
Deprecated; (moved to EditSession)
Scrolls the cursor into the first visibile area of the editor
-Scrolls the cursor into the first visibile area of the editor
-Gracefully scrolls the editor to the row indicated.
-Gracefully scrolls the editor to the row indicated.
-| line | Number | Required. A line number - |
| center | Boolean | Required. If |
| animate | Boolean | Required. If |
| callback | Function | Required. Function to be called after the animation has finished - |
Associates an EditSession.
Associates an EditSession.
Shows the cursor icon.
-Shows the cursor icon.
-Schedules an update to all the back markers in the document.
-Schedules an update to all the back markers in the document.
-Redraw breakpoints.
-Redraw breakpoints.
-Updates the cursor icon.
-Updates the cursor icon.
-Updates the font size.
-Updates the font size.
-Schedules an update to all the front markers in the document.
-Schedules an update to all the front markers in the document.
-Triggers a full update of the text, for all the rows.
-Triggers a full update of the text, for all the rows.
-Blurs the current container.
-Blurs the current container.
-Focuses the current container.
-Focuses the current container.
-