The main class required to set up an Ace instance in the browser.
+ +diff --git a/api/ace.html b/api/ace.html new file mode 100644 index 00000000..c9a86d36 --- /dev/null +++ b/api/ace.html @@ -0,0 +1,85 @@ + +
The main class required to set up an Ace instance in the browser.
+ +Embeds the Ace editor into the DOM, at the element provided by el.
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.
+Both of these objects have a row and column property corresponding to the position.
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.
+ +new CommandManager(platform, commands)
+ +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 |
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'.
| deltas | Object | Required. + |
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.
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 the elements in lines into the document, starting at the row index given by row. This method also triggers the 'change' event.
Inserts a new line into the document at the current row's position. This method also triggers the 'change' event.
Inserts a new line into the document at the current row's position. This method also triggers the 'change' event.
| position | String | Required. The position to insert at + |
Removes the specified columns from the row. 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 + |
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'.
| deltas | Object | Required. + |
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 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 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 the mode is loaded.
+ +Emitted when the mode is loaded.
+ +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 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.
+ +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 position (on screen) for the last character in the provided screen row.
+ +Returns the position (on screen) for the last character in the provided screen row.
+ +| screenRow | Number | Required. The screen row to check + |
Returns the length of the screen.
+ +Returns the length of the screen.
+ +The distance to the next tab stop at the specified screen column.
+ +The distance to the next tab stop at the specified screen column.
+ +| screenColumn | Number | Required. The screen column to check + |
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.
Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.
+ +Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.
+ +| row | Number | Required. The row to start at + |
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.
Given a starting row and column, this method returns the Range of the first word boundary it finds.
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 + |
Shifts all the lines in the document down one, starting from firstRow and ending at lastRow.
Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.
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 annotations for the EditSession. This functions emits the 'changeAnnotation' event.
Sets annotations for the EditSession. This functions emits the 'changeAnnotation' event.
| annotations | Array | Required. A list of annotations + |
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 | Number | 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 |
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.
+ +| scrollLeft | Object | Required. + |
This function sets the scroll top value. It also emits the 'changeScrollTop' event.
This function sets the scroll top value. It also emits the 'changeScrollTop' event.
| scrollTop | Number | Required. The new scroll top value + |
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.
+ +Enables or disables highlighting of the range where an undo occured.
+ +Enables or disables highlighting of the range where an undo occured.
+ +| enable | Boolean | Required. If |
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 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.
+ +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.
Copies all the selected lines down one row.
+ +Copies all the selected lines down one row.
+ +Copies all the selected lines up one row.
+ +Copies all the selected lines up one row.
+ +Cleans up the entire editor.
+ +Cleans up the entire editor.
+ +Attempts to find needle within the document. For more information on options, see Search.
Performs another search for needle in 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.
+ +Gets the current position of the cursor.
+ +Gets the current position of the cursor.
+ +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, such as "vim" or "windows".
+ +Returns the keyboard handler, such as "vim" or "windows".
+ +Returns the index of the last visible row.
+ +Returns the index of the last visible row.
+ +Works like EditSession.getTokenAt(), except it returns a number.
Works like EditSession.getTokenAt(), except it returns a number.
| row | Object | Required. + |
| column | Object | Required. + |
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.
+ +Editor.getWrapBehavioursEnabled() -> Boolean
+ +Editor.getWrapBehavioursEnabled() -> Boolean
+Returns true if the wrapping behaviors are currently enabled.
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.
Editor.modifyNumber(amount)
+ +Editor.modifyNumber(amount)
+ +| amount | Number | Required. The value to change the numeral by (can be negative to decrease value) +If the character before the cursor is a number, this functions changes its value by |
Moves the cursor to the specified row and column. Note that this does not de-select the current selection.
+ +Shifts all the selected lines down one row.
+ +Shifts all the selected lines down one row.
+ +Shifts all the selected lines up one row.
+ +Shifts all the selected lines up one row.
+ +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.
+ +Emitted when the selection changes.
+ +Emitted when the selection changes.
+ +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 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.
+ +Scrolls to a line. If center is true, it puts the line in middle of screen (or attempts to).
Scrolls to a line. If center is true, it puts the 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.
+ +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 + |
Determines whether or not the current line should be highlighted.
+ +Determines whether or not the current line should be highlighted.
+ +| shouldHighlight | Boolean | Required. Set to |
Determines if the currently selected word should be highlighted.
+ +Determines if the currently selected word should be highlighted.
+ +| shouldHighlight | Boolean | Required. Set to |
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.
+ +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 + |
If showPrintMargin is set to true, the print margin is shown in the editor.
If showPrintMargin is set to true, the print margin is shown in the editor.
| showPrintMargin | Boolean | Required. Specifies whether or not to show the print margin + |
Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.
Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.
| theme | String | Required. The path to a theme + |
Editor.setWrapBehavioursEnabled(enabled)
+Editor.setWrapBehavioursEnabled(enabled)
+Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets +when such a character is typed in.
+ +| enabled | Object | Required. + |
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 the lines, or uncomments all of them.
+ +Given the currently selected range, this function either comments all the lines, or uncomments all of them.
+ +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.
+ +Perform an undo operation on the document, reverting the last change.
+ +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.
+ + + + + + + +PlaceHolder.cancel()
+ +PlaceHolder.cancel()
+TODO
+ +PlaceHolder.detach()
+ +PlaceHolder.detach()
+TODO
+ +PlaceHolder.hideOtherMarkers()
+ +PlaceHolder.hideOtherMarkers()
+Hides all over markers in the EditSession that are not the currently selected one.
PlaceHolder.setup()
+ +PlaceHolder.setup()
+TODO
+ +PlaceHolder.showOtherMarkers()
+ +PlaceHolder.showOtherMarkers()
+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 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 + |
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
+
+ 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.
+ +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:
+ [start.row/start.column] -> [end.row/end.column]
+
+ Returns a string containing the range's row and column information, given like this:
+ [start.row/start.column] -> [end.row/end.column]
+
+ Batches changes (that force something to be redrawn) in the background.
+ +| t |
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 +
|
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.
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.
+ +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.
+ +Selects an entire word boundary.
+ +Selects an entire word boundary.
+ +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.
+ +Split.resize() -> Void
+ +Split.resize() -> Void
+Resizes the editor.
+ +| session | EditSession | Required. The new edit session + |
| idx | Number | Required. The editor's index you're interested in +Sets a new |
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.
+ +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.
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.
Perform a redo operation on the document, reimplementing the last change.
+ +Perform a redo operation on the document, reimplementing the last change.
+ +| dontSelect | Boolean | Required. If |
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.
+ +Perform an undo operation on the document, reverting the last change.
+ +| 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)
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 whether the print margin is being shown or not.
+ +Returns whether the 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)
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 + |
Identifies whether you want to have an animated scroll or not.
+ +Identifies whether you want to have an animated scroll or not.
+ +| shouldAnimate | Boolean | Required. Set to |
Identifies whether you want to show the horizontal scrollbar or not.
+ +Identifies whether you want to show the horizontal scrollbar or not.
+ +| alwaysVisible | Boolean | Required. Set to |
Identifies whether you want to show the print margin column or not.
+ +Identifies whether you want to show the print margin column or not.
+ +| showPrintMargin | Boolean | Required. Set to |
Associates the renderer with an EditSession.
Identifies whether you want to show invisible characters or not.
+ +Identifies whether you want to show invisible characters or not.
+ +| showInvisibles | Boolean | Required. Set to |
Identifies whether you want to show the print margin or not.
+ +Identifies whether you want to show the print margin or not.
+ +| showPrintMargin | Boolean | Required. Set to |
Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.
Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.
| theme | String | Required. The path to a theme + |
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.
+ +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.
+ +