Required. Either the id of an element, or the element itself
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/anchor.html b/api/anchor.html
index 2a57d4d0..f3f25cd1 100644
--- a/api/anchor.html
+++ b/api/anchor.html
@@ -1,10 +1,7 @@
-
-
-
- Anchor - Ace API
Required. Identifies if you want the position to be clipped
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/background_tokenizer.html b/api/background_tokenizer.html
index 4f5936e0..8a11bcee 100644
--- a/api/background_tokenizer.html
+++ b/api/background_tokenizer.html
@@ -1,11 +1,8 @@
-
-
-
- BackgroundTokenizer - Ace API
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.
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.
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/command_manager.html b/api/command_manager.html
index 5f54b975..b580d309 100644
--- a/api/command_manager.html
+++ b/api/command_manager.html
@@ -1,8 +1,5 @@
-
-
-
- CommandManager - Ace API
\ No newline at end of file
diff --git a/api/document.html b/api/document.html
index 192f41dc..577fe66f 100644
--- a/api/document.html
+++ b/api/document.html
@@ -1,7 +1,4 @@
-
-
-
- Document - Ace API
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.
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.
Returns the new start property of the range, which contains startRow and startColumn. If range is empty, this function returns the unmodified value of range.start.
\ No newline at end of file
diff --git a/api/edit_session.html b/api/edit_session.html
index 529d0360..64081b69 100644
--- a/api/edit_session.html
+++ b/api/edit_session.html
@@ -1,10 +1,7 @@
-
-
-
- EditSession - Ace API
Stores all the data about Editor state providing easy way to change editors state. EditSession can be attached to only one Document. Same Document can be attached to several EditSessions.
Stores all the data about Editor state providing easy way to change editors state. EditSession can be attached to only one Document. Same Document can be attached to several EditSessions.
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.
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.
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'.
Moves a range of text from the given range to the given position. toPosition is an object that looks like this:
-
EditSession.onReloadTokenizer(e)
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.
Outdents all the rows defined by the start and end properties of range.
+
EditSession.onReloadTokenizer(e)
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.
The new start property of the range, which contains startRow and startColumn. If range is empty, this function returns the unmodified value of range.start.
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.
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.
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.
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.
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.
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.
Required. If true, doesn't select the range of where the change occured
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/editor.html b/api/editor.html
index 362697c2..a7798f30 100644
--- a/api/editor.html
+++ b/api/editor.html
@@ -1,11 +1,8 @@
-
-
-
- Editor - Ace API
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.
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.
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.
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.
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.
\ No newline at end of file
diff --git a/api/index.html b/api/index.html
index 32e65c8f..a4f1f307 100644
--- a/api/index.html
+++ b/api/index.html
@@ -1,7 +1,4 @@
-
-
-
- Ace API
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.
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/placeholder.html b/api/placeholder.html
index 45e7601e..98aa0b55 100644
--- a/api/placeholder.html
+++ b/api/placeholder.html
@@ -1,10 +1,7 @@
-
-
-
- PlaceHolder - Ace API
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.
+
PlaceHolder.hideOtherMarkers()
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.
PlaceHolder.setup()
TODO
TODO
PlaceHolder.showOtherMarkers()
TODO
TODO
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/range.html b/api/range.html
index 9ed3122e..19f69645 100644
--- a/api/range.html
+++ b/api/range.html
@@ -1,7 +1,4 @@
-
-
-
- Range - Ace API
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.
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.
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]
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/renderloop.html b/api/renderloop.html
index 19626ea2..26aa4d16 100644
--- a/api/renderloop.html
+++ b/api/renderloop.html
@@ -1,6 +1,3 @@
-
-
-
- RenderLoop - Ace API
\ No newline at end of file
diff --git a/api/search.html b/api/search.html
index 2e51d956..a2e1f5f3 100644
--- a/api/search.html
+++ b/api/search.html
@@ -1,7 +1,4 @@
-
-
-
- Search - Ace API
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.
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.
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.
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.
Required. An object containing all the new search properties
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/selection.html b/api/selection.html
index d045e4e5..bb08acd7 100644
--- a/api/selection.html
+++ b/api/selection.html
@@ -1,26 +1,23 @@
-
-
-
- Selection - Ace API
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.
Required. The position to remove, as a {row, column} object
+
\ No newline at end of file
diff --git a/api/split.html b/api/split.html
index c9d0ec90..44c46036 100644
--- a/api/split.html
+++ b/api/split.html
@@ -1,39 +1,36 @@
-
-
-
- Split - Ace API
\ No newline at end of file
diff --git a/api/token_iterator.html b/api/token_iterator.html
index 77f2e0f2..a6de2ef9 100644
--- a/api/token_iterator.html
+++ b/api/token_iterator.html
@@ -1,10 +1,7 @@
-
-
-
- TokenIterator - Ace API
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.
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/tokenizer.html b/api/tokenizer.html
index 7ba61563..5ca489e9 100644
--- a/api/tokenizer.html
+++ b/api/tokenizer.html
@@ -1,11 +1,8 @@
-
-
-
- Tokenizer - Ace API
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.
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/undomanager.html b/api/undomanager.html
index 340c9d8d..da876c91 100644
--- a/api/undomanager.html
+++ b/api/undomanager.html
@@ -1,7 +1,4 @@
-
-
-
- UndoManager - Ace API
Required. If true, doesn't select the range of where the change occured
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/api/virtual_renderer.html b/api/virtual_renderer.html
index d2418df0..b61cb4b5 100644
--- a/api/virtual_renderer.html
+++ b/api/virtual_renderer.html
@@ -1,13 +1,10 @@
-
-
-
- VirtualRenderer - Ace API
ACE in Production
@@ -64,45 +68,50 @@
in any web page and JavaScript application. ACE is maintained as the
primary editor for Cloud9 IDE
and is the successor of the Mozilla Skywriter (Bespin) project.
-
+
/**
* In fact, you're looking at ACE right now.
*
* We are currently showing off the JavaScript mode. ACE has support for 45
* language modes and 24 color themes!
*/
-
-var resultString = "Hello, ACE! The result of your math is: ";
+
function add(x, y) {
+ var resultString = "Hello, ACE! The result of your math is: ";
var result = x + y;
return resultString + result;
}
-
+
var addResult = add(3, 2);
console.log(addResult);
Work with huge documents (1,000,000+ lines are no problem)
-
Fully customizable key bindings including VI and Emacs modes
-
Themes (TextMate themes can be imported)
-
Search and replace with regular expressions
-
Highlight matching parentheses
-
Toggle between soft tabs and real tabs
-
Displays hidden characters
-
Highlight selected word
+
Syntax highlighting for over 40 languages (TextMate/Sublime/.tmlanguage files can be imported)
+
Over 20 themes (TextMate/Sublime/.tmtheme files can be imported)
+
Automatic indent and outdent
+
An optional command line
+
Handles huge documents (at last check, 4,000,000 lines is the upper limit)
+
Fully customizable key bindings including vim and Emacs modes
+
Search and replace with regular expressions
+
Highlight matching parentheses
+
Toggle between soft tabs and real tabs
+
Displays hidden characters
+
Drag and drop text using the mouse
+
Line wrapping
+
Code folding
+
Multiple cursors and selections
+
Live syntax checker (currently JavaScript/CoffeeScript/CSS/XQuery)
+
Cut, copy, and paste functionality
-
Getting the code
+
Get the Open-Source Code
ACE is a community project. We actively encourage and support
contributions! The ACE source code is hosted on GitHub
and released under the BSD license ‐
- very simple and friendly to all kinds of projects, whether OSS
+ very simple and friendly to all kinds of projects, whether open-source
or not. Take charge of your editor and add your favorite language
highlighting and keybindings!
git clone git://github.com/ajaxorg/ace.git
@@ -111,7 +120,7 @@ console.log(addResult);
as two independent projects both aiming to build a no compromise
code editor component for the web. Bespin started as part of
Mozilla Labs and was based on the <canvas> tag, while ACE is
- the Editor component of Cloud9 IDE
+ the editor component of Cloud9 IDE
and uses the DOM for rendering. After the release of ACE at
JSConf.eu 2010
in Berlin the Skywriter team decided to merge ACE with a simplified
@@ -130,11 +139,10 @@ console.log(addResult);
Embedding ACE in Your Site
-
ACE can be easily embedded into a web page. After you
- test the code below, check out the How-To Guide
- for more instructions.
Now check out the How-To Guide for instructions on
common operations, such as setting a different language mode or
getting the contents from the editor.
@@ -174,16 +182,17 @@ console.log(addResult);
var ace = require("lib/ace");
-
Nearly Everything you Want to do with ACE
-
In all of these cases ACE has been invoked exactly
- as shown on the embedding guide.
+
Working with ACE
+
In all of these examples ACE has been invoked
+ as shown in the embedding guide.
Setting Themes
-
To change the theme, configure the editor to use the theme using its module name. The theme file will be loaded on demand:
+
Themes are loaded on demand; all you have to do is pass the string name:
editor.setTheme("ace/theme/twilight");
+
> (See all themes)
Setting the Programming Language Mode
-
By default, the editor supports plain text mode. All other language modes are available as separate modules. Modes are also loaded on demand like this:
+
By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:
ACE supports the importing of .tmtheme and .tmlanguage files for use
+in the editor. The task is accomplished by two simple node scripts.
+
+
Importing Textmate/Sublime Themes
+
To import a .tmtheme file into ACE:
+
+
Go to the tool folder, and run npm install to install required
+dependencies.
+
Drop your .tmtheme file into the tmthemes folder.
+
Update the tmtheme.js file to include your new theme.
+
Run node tmtheme.js
+
+
Your .tmtheme will be converted and placed into lib/ace/theme
+alongside other themes. Note that there’s one more class we’ve added
+that isn’t available in regular Textmate themes, and that’s for
+.ace_indent-guide. This class adds indentation guides for your theme,
+using a base64-encoded png. In general, the dark themes and light themes
+each have their own strings, so you can just copy the class from an
+equivalent theme.
+
+
Importing Textmate/Sublime Languages
+
+
If you’re interested in porting over an existing .tmlanguage file into
+Ace’s mode syntax highlighting, there’s a tool to accomplish that, too.
+
+
+
Go to the tool folder. Run npm install to install required
+dependencies.
+
Drop your .tmlanguage file into the tools folder.
+
Run node tmlanguage.js <path_to_tmlanguage_file>, such as
+node tmlanguage.js MyGreatLanguage.tmlanguage.
+
Your .tmlanguage file will be converted to the best of the converter’s
+ability. It is an understatement to say that the tool is imperfect.
+Probably, this will never be able to be fully autogenerated. In
+.tmlanguage files, for instance, one sees the use of
+lookbehinds/negative lookbehinds, which JavaScript regexps simply do not
+have. There’s a list of other non-determinable items, too:
+
+
+
Deciding which state to transition to
+ While the tool does create new states correctly, it labels them
+with generic terms like state_2, state_10e.t.c.
+
+
Extending modes
+ Many modes say something like include source.c, to mean, “add all
+the rules in C highlighting.” That syntax does not make sense to Ace
+or this tool
+
Rule preference order
+
Gathering keywords
+ Most likely, you’ll need to take keywords from your language file
+and run them through createKeywordMapper()
+
+
Two files are created and placed in lib/ace/mode: one for the language
+mode, and one for the set of highlight rules. You will still need to add
+the code into kitchen_sink.html and demo.js, as well as write any
+tests for the highlighting.
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 embedding guide.