Compare commits

..

5 commits

Author SHA1 Message Date
nightwing
84a0246e2c highlight matching tag 2013-09-23 12:14:19 +04:00
nightwing
528e760dcd do not add fold widget for doctype 2013-09-22 02:46:19 +04:00
nightwing
10a759feb7 do not include tag attributes in the fold 2013-09-22 02:46:18 +04:00
nightwing
127270a7aa fix mixed folding misses folds on lines drawn before tokenization is finished 2013-09-22 02:46:18 +04:00
nightwing
04a308e00d make findMatchingBracket faster 2013-09-22 02:46:17 +04:00
657 changed files with 62285 additions and 155866 deletions

2
.gitignore vendored
View file

@ -2,11 +2,9 @@
.DS_Store
*.swp
*.tmp
*~
# Project files that should not be in the repo
.*
\#*
!/.gitignore
.*.gz
*.tmTheme.js

4
.gitmodules vendored
View file

@ -1,6 +1,6 @@
[submodule "doc/wiki"]
path = doc/wiki
url = https://github.com/ajaxorg/ace.wiki.git
url = git://github.com/ajaxorg/ace.wiki.git
[submodule "build"]
path = build
url = https://github.com/ajaxorg/ace-builds.git
url = git://github.com/ajaxorg/ace-builds.git

View file

@ -7,9 +7,16 @@ Feel free to fork and improve/enhance Ace any way you want. If you feel that the
There are two versions of the agreement:
1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects.
1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it.
If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.
Happy coding, Cloud9
Email: ace+cla@c9.io
Fax: +31 (0) 206388953
Address: Ajax.org B.V.
Keizersgracht 241
1016 EA, Amsterdam
the Netherlands

View file

@ -1,103 +1,4 @@
Version 1.2.0-pre
* New Features
- Indented soft wrap (danyaPostfactum)
* API Changes
- unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745)
- "change" event listeners on session and editor get delta objects directly
2015.04.03 Version 1.1.9
- Small Enhancements and Bugfixes
2014.11.08 Version 1.1.8
* API Changes
- `editor.commands.commandKeyBinding` now contains direct map from keys to commands instead of grouping them by hashid
* New Features
- Improved autoindent for html and php modes (Adam Jimenez)
- Find All from searchbox (Colton Voege)
* new language modes
- Elixir, Elm
2014.09.21 Version 1.1.7
* Bugfixes
- fix several bugs in autocompletion
- workaround for inaccurate getBoundingClientRect on chrome 37
2014.08.17 Version 1.1.6
* Bugfixes
- fix regression in double tap to highlight
- Improved Latex Mode (Daniel Felder)
* API Changes
- editor.destroy destroys editor.session too (call editor.setSession(null) to prevent that)
* new language modes
- Praat (José Joaquín Atria)
- Eiffel (Victorien Elvinger)
- G-code (Adam Joseph Cook)
2014.07.09 Version 1.1.5
* Bugfixes
- fix regression in autocomplete popup
* new language modes
- gitignore (Devon Carew)
2014.07.01 Version 1.1.4
* New Features
- Highlight matching tags (Adam Jimenez)
- Improved jump to matching command (Adam Jimenez)
* new language modes
- AppleScript (Yaogang Lian)
- Vala
2014.03.08 Version 1.1.3
* New Features
- Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman)
- Add ColdFusion behavior (Abram Adams)
- add showLineNumbers option
- Add html syntax checker (danyaPostfactum)
* new language modes
- Gherkin (Patrick Nevels)
- Smarty
2013.12.02 Version 1.1.2
* New Features
- Accessibility Theme for Ace (Peter Xiao)
- use snipetManager for expanding emmet snippets
- update jshint to 2.1.4
- improve php syntax checker (jdalegonzalez)
- add option for autoresizing
- add option for autohiding vertical scrollbar
- improvements to highlighting of xml like languages (danyaPostfactum)
- add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
- add option to merge similar changes in undo history
- add scrollPastEnd option
- use html5 dragndrop for text dragging (danyaPostfactum)
* API Changes
- fixed typo in HashHandler commmandManager
* new language modes
- Nix (Zef Hemel)
- Protobuf (Zef Hemel)
- Soy
- Handlebars
2013.06.04 Version 1.1.1
2013.06.04 Version 1.1.01
- Improved emacs keybindings (Robert Krahn)
- Added markClean, isClean methods to UndoManager (Joonsoo Jeon)

View file

@ -13,6 +13,7 @@ pre_build:
build: pre_build
./Makefile.dryice.js normal
./Makefile.dryice.js demo
./Makefile.dryice.js bm
# Minimal build: call Makefile.dryice.js only if our sources changed
basic: build/src/ace.js

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ Ace is a standalone code editor written in JavaScript. Our goal is to create a b
Features
--------
* Syntax highlighting for over 110 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
* 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
@ -30,7 +30,7 @@ Take Ace for a spin!
Check out the Ace live [demo](http://ace.c9.io/build/kitchen-sink.html) or get a [Cloud9 IDE account](https://c9.io/) to experience Ace while editing one of your own GitHub projects.
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.io/ace/build/demo/bookmarklet/index.html).
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.io/ace/build/textarea/editor.html).
Embedding Ace
-------------
@ -79,7 +79,7 @@ By default the editor only supports plain text mode; many other languages are av
The mode can then be used like this:
```javascript
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
var JavaScriptMode = require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode());
```

View file

@ -390,8 +390,8 @@
</div>
<div class="description"><p>Creates a new <code>Editor</code> object.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">renderer</td><td class="argType"><a href="virtual_renderer.html" class="" title="VirtualRenderer (class)" data-id="VirtualRenderer">VirtualRenderer</a></td><td class="argDescription "><p>Required. Associated <code>VirtualRenderer</code> that draws everything</p>
</td></tr><tr class="argumentRow "><td class="argName ">session</td><td class="argType"><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The <code>EditSession</code> to refer to</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">renderer</td><td class="argType" "><a href="virtual_renderer.html" class="" title="VirtualRenderer (class)" data-id="VirtualRenderer">VirtualRenderer</a></td><td class="argDescription "><p>Required. Associated <code>VirtualRenderer</code> that draws everything</p>
</td></tr><tr class="argumentRow "><td class="argName ">session</td><td class="argType" "><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The <code>EditSession</code> to refer to</p>
</td></tr></table>
</div>
</div>
@ -444,7 +444,7 @@
</div>
<div class="description"><p>Emitted whenever the document is changed.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains a single property, <code>data</code>, which has the delta of changes</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains a single property, <code>data</code>, which has the delta of changes</p>
</td></tr></table>
</div>
</div>
@ -471,7 +471,7 @@
</div>
<div class="description"><p>Emitted when the selection style changes, via <a href="#Editor.setSelectionStyle" class="link-short" title="Editor.setSelectionStyle (class method)" data-id="Editor.setSelectionStyle"><code>Editor.setSelectionStyle()</code></a>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">data</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains one property, <code>data</code>, which indicates the new selection style</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">data</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains one property, <code>data</code>, which indicates the new selection style</p>
</td></tr></table>
</div>
</div>
@ -498,7 +498,7 @@
</div>
<div class="description"><p>Emitted whenever the <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a> changes.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, <code>oldSession</code> and <code>session</code>, that represent the old and new <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a>s.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, <code>oldSession</code> and <code>session</code>, that represent the old and new <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a>s.</p>
</td></tr></table>
</div>
</div>
@ -525,7 +525,7 @@
</div>
<div class="description"><p>Emitted when text is copied.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The copied text</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The copied text</p>
</td></tr></table>
</div>
</div>
@ -564,7 +564,7 @@
<ul class="signatures">
<li class="signature">
<ul>
<li class="signature-call"><span class="eventObjName">Editor</span><span class="eventListenerStart">.on("</span><span id="Editor.event.paste" class="member-name eventMember methodClicker">paste</span><span class="eventListenerClose">", </span><span class="eventFunctionOpen">function(</span><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="argument methodClicker" title="Object" data-id="Object">Object</a> e<span class="eventFunctionClose">))</span></li>
<li class="signature-call"><span class="eventObjName">Editor</span><span class="eventListenerStart">.on("</span><span id="Editor.event.paste" class="member-name eventMember methodClicker">paste</span><span class="eventListenerClose">", </span><span class="eventFunctionOpen">function(</span><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="argument methodClicker" title="String" data-id="String">String</a> text<span class="eventFunctionClose">))</span></li>
</ul>
<ul class="metaInfo">
</ul>
@ -577,7 +577,7 @@
</div>
<div class="description"><p>Emitted when text is pasted.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object which contains one property, <code>text</code>, that represents the text to be pasted. Editing this property will alter the text that is pasted.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
</td></tr></table>
</div>
</div>
@ -610,7 +610,7 @@
</div>
<div class="description"><p>Adds the selection and cursor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">orientedRange</td><td class="argType"><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. A range containing a cursor</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">orientedRange</td><td class="argType" "><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. A range containing a cursor</p>
</td></tr></table>
</div>
</div>
@ -920,9 +920,9 @@
</div>
<div class="description"><p>Attempts to find <code>needle</code> within the document. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">needle</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to search for (optional)</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object defining various search properties</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">needle</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to search for (optional)</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object defining various search properties</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
</td></tr></table>
</div>
</div>
@ -954,9 +954,9 @@
</div>
<div class="description"><p>Finds and selects all the occurences of <code>needle</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. text to find</p>
</td></tr><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">keeps</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. </p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. text to find</p>
</td></tr><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">keeps</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. </p>
</td></tr></table>
</div>
</div>
@ -983,8 +983,8 @@
</div>
<div class="description"><p>Performs another search for <code>needle</code> in the document. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
</td></tr></table>
</div>
</div>
@ -1011,8 +1011,8 @@
</div>
<div class="description"><p>Performs a search for <code>needle</code> backwards. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
</td></tr></table>
</div>
</div>
@ -1064,8 +1064,8 @@
</div>
<div class="description"><p>Executes a command for each selection range.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">cmd</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The command to execute</p>
</td></tr><tr class="argumentRow "><td class="argName ">args</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. Any arguments for the command</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">cmd</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The command to execute</p>
</td></tr><tr class="argumentRow "><td class="argName ">args</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. Any arguments for the command</p>
</td></tr></table>
</div>
</div>
@ -1523,8 +1523,8 @@
</div>
<div class="description"><p>Works like <a href="#nav=api&api=edit_session" class="link-short" title="EditSession.getTokenAt (class method)" data-id="EditSession.getTokenAt"><code>EditSession.getTokenAt()</code></a>, except it returns a number.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr></table>
</div>
</div>
@ -1966,9 +1966,9 @@
</div>
<div class="description"><p>Moves the cursor to the specified line number, and also into the indiciated column.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">lineNumber</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line number to go to</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A column number to go to</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scolling</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">lineNumber</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line number to go to</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A column number to go to</p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scolling</p>
</td></tr></table>
</div>
</div>
@ -2070,7 +2070,7 @@
</div>
<div class="description"><p>Inserts <code>text</code> into wherever the cursor is pointing.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new text to add</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new text to add</p>
</td></tr></table>
</div>
</div>
@ -2132,7 +2132,7 @@
</div>
<div class="description"><p>Indicates if the entire row is currently visible on the screen.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
</td></tr></table>
</div>
</div>
@ -2164,7 +2164,7 @@
</div>
<div class="description"><p>Indicates if the row is currently visible on the screen.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
</td></tr></table>
</div>
</div>
@ -2191,7 +2191,7 @@
</div>
<div class="description"><p>Moves the cursor&#39;s row and column to the next matching bracket.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">select</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">select</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr></table>
</div>
</div>
@ -2218,7 +2218,7 @@
</div>
<div class="description"><p>If the character before the cursor is a number, this functions changes its value by <code>amount</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">amount</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The value to change the numeral by (can be negative to decrease value)</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">amount</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The value to change the numeral by (can be negative to decrease value)</p>
</td></tr></table>
</div>
</div>
@ -2245,8 +2245,8 @@
</div>
<div class="description"><p>Moves the cursor to the specified row and column. Note that this does not de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
</td></tr></table>
</div>
</div>
@ -2273,7 +2273,7 @@
</div>
<div class="description"><p>Moves the cursor to the position indicated by <code>pos.row</code> and <code>pos.column</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">pos</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, row and column</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">pos</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, row and column</p>
</td></tr></table>
</div>
</div>
@ -2384,7 +2384,7 @@
</div>
<div class="description"><p>Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
</td></tr></table>
</div>
</div>
@ -2461,7 +2461,7 @@
</div>
<div class="description"><p>Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
</td></tr></table>
</div>
</div>
@ -2538,7 +2538,7 @@
</div>
<div class="description"><p>Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
</td></tr></table>
</div>
</div>
@ -2565,8 +2565,8 @@
</div>
<div class="description"><p>Moves the cursor to the specified row and column. Note that this does de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
</td></tr></table>
</div>
</div>
@ -2593,7 +2593,7 @@
</div>
<div class="description"><p>Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
</td></tr></table>
</div>
</div>
@ -3105,7 +3105,7 @@
</div>
<div class="description"><p>Called whenever a text &quot;paste&quot; happens.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
</td></tr></table>
</div>
</div>
@ -3277,7 +3277,7 @@
</div>
<div class="description"><p>Removes words of text from the editor. A &quot;word&quot; is defined as a string of characters bookended by whitespace.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The direction of the deletion to occur, either &quot;left&quot; or &quot;right&quot;</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The direction of the deletion to occur, either &quot;left&quot; or &quot;right&quot;</p>
</td></tr></table>
</div>
</div>
@ -3329,7 +3329,7 @@
</div>
<div class="description"><p>Removes the selection marker.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. selection range added with <a href="#nav=api&api=multi_select" class="link-short" title="Editor.addSelectionMarker (class method)" data-id="Editor.addSelectionMarker"><code>addSelectionMarker()</code></a>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. selection range added with <a href="#nav=api&api=multi_select" class="link-short" title="Editor.addSelectionMarker (class method)" data-id="Editor.addSelectionMarker"><code>addSelectionMarker()</code></a>.</p>
</td></tr></table>
</div>
</div>
@ -3456,8 +3456,8 @@
</div>
<div class="description"><p>Replaces the first occurance of <code>options.needle</code> with the value in <code>replacement</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
</td></tr></table>
</div>
</div>
@ -3484,8 +3484,8 @@
</div>
<div class="description"><p>Replaces all occurances of <code>options.needle</code> with the value in <code>replacement</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
</td></tr></table>
</div>
</div>
@ -3512,7 +3512,7 @@
</div>
<div class="description"><p>Triggers a resize of the editor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">force</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, recomputes the size, even if the height and width haven&#39;t changed</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">force</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, recomputes the size, even if the height and width haven&#39;t changed</p>
</td></tr></table>
</div>
</div>
@ -3613,10 +3613,10 @@
</div>
<div class="description"><p>Scrolls to a line. If <code>center</code> is <code>true</code>, it puts the line in middle of screen (or attempts to).</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">line</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line to scroll to</p>
</td></tr><tr class="argumentRow "><td class="argName ">center</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code></p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scrolling</p>
</td></tr><tr class="argumentRow "><td class="argName ">callback</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function" class="" title="Function" data-id="Function">Function</a></td><td class="argDescription "><p>Required. Function to be called when the animation has finished</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">line</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line to scroll to</p>
</td></tr><tr class="argumentRow "><td class="argName ">center</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code></p>
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scrolling</p>
</td></tr><tr class="argumentRow "><td class="argName ">callback</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function" class="" title="Function" data-id="Function">Function</a></td><td class="argDescription "><p>Required. Function to be called when the animation has finished</p>
</td></tr></table>
</div>
</div>
@ -3643,7 +3643,7 @@
</div>
<div class="description"><p>Moves the editor to the specified row.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr></table>
</div>
</div>
@ -3695,8 +3695,8 @@
</div>
<div class="description"><p>Finds the next occurence of text in an active selection and adds it to the selections.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
</td></tr></table>
</div>
</div>
@ -3723,8 +3723,8 @@
</div>
<div class="description"><p>Adds a cursor above or below the active cursor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
</td></tr></table>
</div>
</div>
@ -3825,7 +3825,7 @@
</div>
<div class="description"><p>Specifies whether to use behaviors or not. &quot;Behaviors&quot; in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables behaviors</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables behaviors</p>
</td></tr></table>
</div>
</div>
@ -3876,7 +3876,7 @@
</div>
<div class="description"><p>Sets the delay (in milliseconds) of the mouse drag.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dragDelay</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new delay</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dragDelay</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new delay</p>
</td></tr></table>
</div>
</div>
@ -3927,7 +3927,7 @@
</div>
<div class="description"><p>Set a new font size (in pixels) for the editor text.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">size</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A font size</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">size</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A font size</p>
</td></tr></table>
</div>
</div>
@ -3954,7 +3954,7 @@
</div>
<div class="description"><p>Determines whether or not the current line should be highlighted.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the current line</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the current line</p>
</td></tr></table>
</div>
</div>
@ -4005,7 +4005,7 @@
</div>
<div class="description"><p>Determines if the currently selected word should be highlighted.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the currently selected word</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the currently selected word</p>
</td></tr></table>
</div>
</div>
@ -4032,7 +4032,7 @@
</div>
<div class="description"><p>Sets a new key handler, such as &quot;vim&quot; or &quot;windows&quot;.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">keyboardHandler</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new key handler</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">keyboardHandler</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new key handler</p>
</td></tr></table>
</div>
</div>
@ -4059,7 +4059,7 @@
</div>
<div class="description"><p>Pass in <code>true</code> to enable overwrites in your session, or <code>false</code> to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of <code>overwrite</code> changes, this function also emites the <code>changeOverwrite</code> event.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">overwrite</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Defines wheter or not to set overwrites</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">overwrite</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Defines wheter or not to set overwrites</p>
</td></tr></table>
</div>
</div>
@ -4086,7 +4086,7 @@
</div>
<div class="description"><p>Sets the column defining where the print margin should be.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Specifies the new print margin</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Specifies the new print margin</p>
</td></tr></table>
</div>
</div>
@ -4113,7 +4113,7 @@
</div>
<div class="description"><p>If <code>readOnly</code> is true, then the editor is set to read-only mode, and none of the content can change.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">readOnly</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the editor can be modified or not</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">readOnly</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the editor can be modified or not</p>
</td></tr></table>
</div>
</div>
@ -4140,7 +4140,7 @@
</div>
<div class="description"><p>Sets how fast the mouse scrolling should do.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">speed</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new speed (in milliseconds)</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">speed</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new speed (in milliseconds)</p>
</td></tr></table>
</div>
</div>
@ -4170,7 +4170,7 @@
although this code change in the future.</p>
<p>This function also emits the <code>&#39;changeSelectionStyle&#39;</code> event.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new selection style</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new selection style</p>
</td></tr></table>
</div>
</div>
@ -4197,7 +4197,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>Sets a new editsession to use. This method also emits the <code>&#39;changeSession&#39;</code> event.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">session</td><td class="argType"><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The new session to use</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">session</td><td class="argType" "><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The new session to use</p>
</td></tr></table>
</div>
</div>
@ -4224,7 +4224,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>Indicates whether the fold widgets are shown or not.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">show</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the fold widgets are shown</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">show</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the fold widgets are shown</p>
</td></tr></table>
</div>
</div>
@ -4251,7 +4251,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>If <code>showInvisibles</code> is set to <code>true</code>, invisible characters&mdash;like spaces or new lines&mdash;are show in the editor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showInvisibles</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show invisible characters</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showInvisibles</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show invisible characters</p>
</td></tr></table>
</div>
</div>
@ -4278,7 +4278,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>If <code>showPrintMargin</code> is set to <code>true</code>, the print margin is shown in the editor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show the print margin</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show the print margin</p>
</td></tr></table>
</div>
</div>
@ -4305,7 +4305,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>Adds a new class, <code>style</code>, to the editor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. A class name</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. A class name</p>
</td></tr></table>
</div>
</div>
@ -4332,7 +4332,7 @@ although this code change in the future.</p>
</div>
<div class="description"><p>Sets a new theme for the editor. <code>theme</code> should exist, and be a directory path, like <code>ace/theme/textmate</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">theme</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The path to a theme</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">theme</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The path to a theme</p>
</td></tr></table>
</div>
</div>
@ -4364,8 +4364,8 @@ although this code change in the future.</p>
</div>
<div class="description"><p>Sets the current document to <code>val</code>.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">val</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new value to set for the document</p>
</td></tr><tr class="argumentRow "><td class="argName ">cursorPos</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Where to set the new value. <code>undefined</code> or 0 is selectAll, -1 is at the document start, and 1 is at the end</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">val</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new value to set for the document</p>
</td></tr><tr class="argumentRow "><td class="argName ">cursorPos</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Where to set the new value. <code>undefined</code> or 0 is selectAll, -1 is at the document start, and 1 is at the end</p>
</td></tr></table>
</div>
</div>
@ -4394,7 +4394,7 @@ when such a character is typed in.</p>
<div class="description"><p>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.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables wrapping behaviors</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables wrapping behaviors</p>
</td></tr></table>
</div>
</div>
@ -4595,7 +4595,7 @@ when such a character is typed in.</p>
</div>
<div class="description"><p>Transposes the selected ranges.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction to rotate selections</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction to rotate selections</p>
</td></tr></table>
</div>
</div>
@ -4647,7 +4647,7 @@ when such a character is typed in.</p>
</div>
<div class="description"><p>Removes the class <code>style</code> from the editor.</p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
</td></tr></table>
</div>
</div>

View file

@ -163,7 +163,7 @@
<article id="Selection" data-title="Selection (class)" class="article">
<div class="section description">
<div class="memberContent"><p>Contains the cursor position and the text selection of an edit session.</p>
<p>The row/columns used in the selection are in document coordinates representing the coordinates as they appear in the document before applying soft wrap and folding.</p>
<p>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.</p>
</div>
</div>
@ -1778,4 +1778,4 @@
<script defer src="./resources/javascripts/disqus-ext.js"></script>
<script defer src="./resources/javascripts/ga.js"></script>
<div id="disqus_thread"></div>
</div>
</div>

2
build

@ -1 +1 @@
Subproject commit a4e495d8901876c6bafe3870a35cb8e32c827e97
Subproject commit 8f2423d10a7cc5680dcdb42a2dd57d9b192e3b34

View file

@ -8,8 +8,8 @@
body {
overflow: hidden;
}
#editor {
#editor {
margin: 0;
position: absolute;
top: 0;
@ -27,7 +27,7 @@
alert("Ace Rocks " + items[i]);
}
}</pre>
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");

View file

@ -20,7 +20,7 @@ function foo() {
var bar = true;
}</textarea><br>
SourceUrl: <br>
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace-builds/src-noconflict"></input><br>
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace-builds/textarea/src/"></input><br>
<button id="buBuild">Build Link</button> <br> <a href="#"></a>
<a href="https://github.com/ajaxorg/ace/">
<div class="fork_on_github" ></div>
@ -49,60 +49,63 @@ function foo() {
<script>
function inject(options, callback) {
var baseUrl = options.baseUrl || "../../src-noconflict";
var load = function(path, callback) {
function inject(callback) {
var baseUrl = "src/";
var load = window.__ace_loader__ = function(path, module, callback) {
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('script');
s.src = baseUrl + "/" + path;
s.src = baseUrl + path;
head.appendChild(s);
s.onload = s.onreadystatechange = function(_, isAbort) {
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
s = s.onload = s.onreadystatechange = null;
if (!isAbort)
callback();
}
s.onload = function() {
window.__ace_shadowed__.require([module], callback);
};
};
load("ace.js", function() {
ace.config.loadModule("ace/ext/textarea", function() {
var event = ace.require("ace/lib/event");
var areas = document.getElementsByTagName("textarea");
for (var i = 0; i < areas.length; i++) {
event.addListener(areas[i], "click", function(e) {
if (e.detail == 3) {
ace.transformTextarea(e.target, options.ace);
}
});
}
callback && callback();
});
load('ace-bookmarklet.js', "ace/ext/textarea", function() {
var ace = window.__ace_shadowed__;
ace.options.mode = "javascript";
var Event = ace.require("ace/lib/event");
var areas = document.getElementsByTagName("textarea");
for (var i = 0; i < areas.length; i++) {
Event.addListener(areas[i], "click", function(e) {
if (e.detail == 3) {
ace.transformTextarea(e.target, load);
}
});
}
callback && callback();
});
}
// Call the inject function to load the ace files.
var textAce;
inject({}, function () {
inject(function () {
// Transform the textarea on the page into an ace editor.
var ace = window.__ace_shadowed__;
var t = document.querySelector("textarea");
textAce = ace.require("ace/ext/textarea").transformTextarea(t);
textAce = ace.transformTextarea(t, window.__ace_loader__);
setTimeout(function(){textAce.setDisplaySettings(true)});
});
document.getElementById("buBuild").onclick = function() {
var injectSrc = inject.toString().split("\n").join("");
injectSrc = injectSrc.replace('baseUrl = "src/"', 'baseUrl="' + document.getElementById("srcURL").value + '"');
var aceOptions = textAce.getOptions();
var opt = [];
for (var option in aceOptions) {
opt.push(option + ":'" + aceOptions[option] + "'");
}
injectSrc = injectSrc.replace('ace.options.mode = "javascript"', 'ace.options = { ' + opt.join(",") + ' }');
injectSrc = injectSrc.replace(/\s+/g, " ");
var options = textAce.getOptions();
options.baseUrl = document.getElementById("srcURL").value;
var a = document.querySelector("a");
a.href = "javascript:(" + injectSrc + ")(" + JSON.stringify(options) + ")";
a.href = "javascript:(" + injectSrc + ")()";
a.innerHTML = "Ace Bookmarklet Link";
}

View file

@ -3,7 +3,7 @@
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
@ -14,7 +14,7 @@
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -38,62 +38,69 @@
var ACE_NAMESPACE = "";
var global = (function() { return this; })();
if (!global && typeof window != "undefined") global = window; // strict mode
var global = (function() {
return this;
})();
if (!ACE_NAMESPACE && typeof requirejs !== "undefined")
return;
var define = function(module, deps, payload) {
if (typeof module !== "string") {
if (define.original)
define.original.apply(this, arguments);
var _define = function(module, deps, payload) {
if (typeof module !== 'string') {
if (_define.original)
_define.original.apply(window, arguments);
else {
console.error("dropping module because define wasn\'t a string.");
console.error('dropping module because define wasn\'t a string.');
console.trace();
}
return;
}
if (arguments.length == 2)
payload = deps;
if (!define.modules[module]) {
define.payloads[module] = payload;
define.modules[module] = null;
}
};
define.modules = {};
define.payloads = {};
if (!_define.modules) {
_define.modules = {};
_define.payloads = {};
}
_define.payloads[module] = payload;
_define.modules[module] = null;
};
/**
* Get at functionality define()ed using the function above
*/
var _require = function(parentId, module, callback) {
if (typeof module === "string") {
var payload = lookup(parentId, module);
if (payload != undefined) {
callback && callback();
return payload;
}
} else if (Object.prototype.toString.call(module) === "[object Array]") {
if (Object.prototype.toString.call(module) === "[object Array]") {
var params = [];
for (var i = 0, l = module.length; i < l; ++i) {
var dep = lookup(parentId, module[i]);
if (dep == undefined && require.original)
return;
if (!dep && _require.original)
return _require.original.apply(window, arguments);
params.push(dep);
}
return callback && callback.apply(null, params) || true;
if (callback) {
callback.apply(null, params);
}
}
};
else if (typeof module === 'string') {
var payload = lookup(parentId, module);
if (!payload && _require.original)
return _require.original.apply(window, arguments);
var require = function(module, callback) {
var packagedModule = _require("", module, callback);
if (packagedModule == undefined && require.original)
return require.original.apply(this, arguments);
return packagedModule;
if (callback) {
callback();
}
return payload;
}
else {
if (_require.original)
return _require.original.apply(window, arguments);
}
};
var normalizeModule = function(parentId, moduleName) {
@ -112,6 +119,7 @@ var normalizeModule = function(parentId, moduleName) {
moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
}
}
return moduleName;
};
@ -120,11 +128,12 @@ var normalizeModule = function(parentId, moduleName) {
* definition function if needed.
*/
var lookup = function(parentId, moduleName) {
moduleName = normalizeModule(parentId, moduleName);
var module = define.modules[moduleName];
var module = _define.modules[moduleName];
if (!module) {
module = define.payloads[moduleName];
module = _define.payloads[moduleName];
if (typeof module === 'function') {
var exports = {};
var mod = {
@ -140,15 +149,19 @@ var lookup = function(parentId, moduleName) {
var returnValue = module(req, exports, mod);
exports = returnValue || mod.exports;
define.modules[moduleName] = exports;
delete define.payloads[moduleName];
_define.modules[moduleName] = exports;
delete _define.payloads[moduleName];
}
module = define.modules[moduleName] = exports || module;
module = _define.modules[moduleName] = exports || module;
}
return module;
};
function exportAce(ns) {
var require = function(module, callback) {
return _require("", module, callback);
};
var root = global;
if (ns) {
if (!global[ns])
@ -157,13 +170,13 @@ function exportAce(ns) {
}
if (!root.define || !root.define.packaged) {
define.original = root.define;
root.define = define;
_define.original = root.define;
root.define = _define;
root.define.packaged = true;
}
if (!root.require || !root.require.packaged) {
require.original = root.require;
_require.original = root.require;
root.require = require;
root.require.packaged = true;
}

View file

@ -4,7 +4,7 @@ body {
margin:0;
padding:0;
background-color:#e6f5fc;
}
H2, H3, H4 {
@ -58,7 +58,7 @@ PRE{
position:relative;
overflow:hidden;
background: url(images/background.png) repeat-x 0 0;
border-bottom:1px solid #c9e8fa;
border-bottom:1px solid #c9e8fa;
}
#header .content .signature {
@ -224,3 +224,7 @@ UL.menu-footer LI A {
UL.menu-footer LI A:hover {
text-decoration:underline;
}

View file

@ -35,8 +35,7 @@
// enable autocompletion and snippets
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: false
enableSnippets: true
});
</script>

View file

@ -7,62 +7,42 @@
<style type="text/css" media="screen">
.ace_editor {
position: relative !important;
border: 1px solid lightgray;
margin: auto;
height: 200px;
width: 80%;
}
.scrollmargin {
height: 80px;
height: 100px;
text-align: center;
}
</style>
</head>
<body>
<pre id="editor1">autoresizing editor</pre>
<pre id="editor">autoresizing editor</pre>
<div class="scrollmargin"></div>
<pre id="editor2">minHeight = 2 lines</pre>
<div class="scrollmargin"></div>
<pre id="editor3" style="width: 40%;"></pre>
<div class="scrollmargin"></div>
<pre id="editor"></pre>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src/ace.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace"], function(ace) {
var editor1 = ace.edit("editor1");
editor1.setTheme("ace/theme/tomorrow_night_eighties");
editor1.session.setMode("ace/mode/html");
editor1.setAutoScrollEditorIntoView(true);
editor1.setOption("maxLines", 30);
// create first editor
var editor = ace.edit("editor");
editor.setTheme("ace/theme/tomorrow");
editor.session.setMode("ace/mode/html");
editor.setAutoScrollEditorIntoView();
editor.setOption("maxLines", 100);
var editor2 = ace.edit("editor2");
editor2.setTheme("ace/theme/tomorrow_night_blue");
editor2.session.setMode("ace/mode/html");
editor2.setAutoScrollEditorIntoView();
editor2.setOption("maxLines", 30);
editor2.setOption("minLines", 2);
var editor2 = ace.edit("editor2");
editor2.setTheme("ace/theme/tomorrow_night_blue");
editor2.session.setMode("ace/mode/html");
editor2.setAutoScrollEditorIntoView(true);
editor2.setOption("maxLines", 30);
editor2.setOption("minLines", 2);
var editor = ace.edit("editor3");
editor.setOptions({
autoScrollEditorIntoView: true,
maxLines: 8
});
editor.renderer.setScrollMargin(10, 10, 10, 10);
var editor = ace.edit("editor");
editor.setTheme("ace/theme/tomorrow");
editor.session.setMode("ace/mode/html");
editor.setAutoScrollEditorIntoView(true);
editor.setOption("maxLines", 100);
});
</script>
<script src="./show_own_source.js"></script>
</body>
</html>

View file

@ -22,20 +22,19 @@
<pre id="editor"></pre>
<!-- load emmet code and snippets compiled for browser -->
<script src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
<script src="kitchen-sink/require.js"></script>
<!-- load ace -->
<script src="../build/src-noconflict/ace.js"></script>
<!-- load ace emmet extension -->
<script src="../build/src-noconflict/ext-emmet.js"></script>
<!-- load core emmet files -->
<script src="http://nightwing.github.io/emmet-core/emmet.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace", "ace/ext/emmet"], function(ace) {
// trigger extension
ace.require("ace/ext/emmet");
var editor = ace.edit("editor");
editor.session.setMode("ace/mode/html");
// enable emmet on the current editor
editor.setOption("enableEmmet", true);
});
editor.setOption("enableEmmet", true);
</script>
<script src="./show_own_source.js"></script>

View file

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ACE Editor StatusBar Demo</title>
<style type="text/css" media="screen">
/*!important without this top: 0; bottom: 0 doesn't work on old ie */
/*!important without this top: 0; bottom: 0 doesn't work */
body, html {
position: absolute;
top: 0px; bottom: 0; left: 0; right: 0;

View file

@ -22,11 +22,8 @@
<pre id="editor"></pre>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src-noconflict/ace.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
require(["ace/ace"], function(ace) {
var editor = ace.edit("editor")
editor.setTheme("ace/theme/twilight")
editor.session.setMode("ace/mode/html")
@ -42,8 +39,6 @@ require(["ace/ace"], function(ace) {
})
}
})
editor.execCommand("showKeyboardShortcuts")
})
</script>
<script src="./show_own_source.js"></script>

View file

@ -33,13 +33,6 @@ define(function(require, exports, module) {
"use strict";
require("ace/lib/fixoldbrowsers");
require("ace/multi_select");
require("ace/ext/spellcheck");
require("./inline_editor");
require("./dev_util");
require("./file_drop");
var config = require("ace/config");
config.init();
var env = {};
@ -58,14 +51,12 @@ var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var Editor = require("ace/editor").Editor;
var MultiSelect = require("ace/multi_select").MultiSelect;
var whitespace = require("ace/ext/whitespace");
var doclist = require("./doclist");
var modelist = require("ace/ext/modelist");
var themelist = require("ace/ext/themelist");
var layout = require("./layout");
var TokenTooltip = require("./token_tooltip").TokenTooltip;
var util = require("./util");
@ -98,6 +89,8 @@ split.on("focus", function(editor) {
env.split = split;
window.env = env;
// add multiple cursor support to editor
require("ace/multi_select").MultiSelect(env.editor);
var consoleEl = dom.createElement("div");
container.parentNode.appendChild(consoleEl);
@ -166,11 +159,11 @@ env.editor.commands.addCommands([{
bindKey: "ctrl+enter",
exec: function(editor) {
try {
var r = window.eval(editor.getCopyText() || editor.getValue());
var r = window.eval(editor.getCopyText()||editor.getValue());
} catch(e) {
r = e;
}
editor.cmdLine.setValue(r + "");
editor.cmdLine.setValue(r + "")
},
readOnly: true
}, {
@ -179,26 +172,26 @@ env.editor.commands.addCommands([{
exec: function(editor) {
config.loadModule("ace/ext/keybinding_menu", function(module) {
module.init(editor);
editor.showKeyboardShortcuts();
});
editor.showKeyboardShortcuts()
})
}
}, {
name: "increaseFontSize",
bindKey: "Ctrl-=|Ctrl-+",
bindKey: "Ctrl-+",
exec: function(editor) {
var size = parseInt(editor.getFontSize(), 10) || 12;
editor.setFontSize(size + 1);
}
}, {
name: "decreaseFontSize",
bindKey: "Ctrl+-|Ctrl-_",
bindKey: "Ctrl+-",
exec: function(editor) {
var size = parseInt(editor.getFontSize(), 10) || 12;
editor.setFontSize(Math.max(size - 1 || 1));
}
}, {
name: "resetFontSize",
bindKey: "Ctrl+0|Ctrl-Numpad0",
bindKey: "Ctrl+0",
exec: function(editor) {
editor.setFontSize(12);
}
@ -226,7 +219,7 @@ commands.addCommand({
bindKey: {win: "Ctrl-S", mac: "Command-S"},
exec: function(arg) {
var session = env.editor.session;
var name = session.name.match(/[^\/]+$/);
name = session.name.match(/[^\/]+$/)
localStorage.setItem(
"saved_file:" + name,
session.getValue()
@ -240,7 +233,7 @@ commands.addCommand({
bindKey: {win: "Ctrl-O", mac: "Command-O"},
exec: function(arg) {
var session = env.editor.session;
var name = session.name.match(/[^\/]+$/);
name = session.name.match(/[^\/]+$/)
var value = localStorage.getItem("saved_file:" + name);
if (typeof value == "string") {
session.setValue(value);
@ -251,7 +244,7 @@ commands.addCommand({
}
});
var keybindings = {
var keybindings = {
ace: null, // Null = use "default" keymapping
vim: require("ace/keyboard/vim").handler,
emacs: "ace/keyboard/emacs",
@ -315,25 +308,26 @@ doclist.history = doclist.docs.map(function(doc) {
});
doclist.history.index = 0;
doclist.cycleOpen = function(editor, dir) {
var h = this.history;
var h = this.history
h.index += dir;
if (h.index >= h.length)
if (h.index >= h.length)
h.index = 0;
else if (h.index <= 0)
h.index = h.length - 1;
var s = h[h.index];
docEl.value = s;
docEl.onchange();
};
h.index
}
doclist.addToHistory = function(name) {
var h = this.history;
var h = this.history
var i = h.indexOf(name);
if (i != h.index) {
if (i != -1)
h.splice(i, 1);
h.index = h.push(name);
}
};
}
bindDropdown("doc", function(name) {
doclist.loadDoc(name, function(session) {
@ -371,26 +365,20 @@ function updateUIEditorOptions() {
saveOption(behavioursEl, editor.getBehavioursEnabled());
}
themelist.themes.forEach(function(x){ x.value = x.theme });
fillDropdown(themeEl, {
Bright: themelist.themes.filter(function(x){return !x.isDark}),
Dark: themelist.themes.filter(function(x){return x.isDark}),
});
event.addListener(themeEl, "mouseover", function(e){
themeEl.desiredValue = e.target.value;
if (!themeEl.$timer)
themeEl.$timer = setTimeout(themeEl.updateTheme);
this.desiredValue = e.target.value;
if (!this.$timer)
this.$timer = setTimeout(this.updateTheme);
});
event.addListener(themeEl, "mouseout", function(e){
themeEl.desiredValue = null;
if (!themeEl.$timer)
themeEl.$timer = setTimeout(themeEl.updateTheme, 20);
this.desiredValue = null;
if (!this.$timer)
this.$timer = setTimeout(this.updateTheme, 20);
});
themeEl.updateTheme = function(){
env.split.setTheme((themeEl.desiredValue || themeEl.selectedValue));
env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue);
themeEl.$timer = null;
};
@ -415,11 +403,28 @@ bindDropdown("folding", function(value) {
});
bindDropdown("soft_wrap", function(value) {
env.editor.setOption("wrap", value);
var session = env.editor.session;
var renderer = env.editor.renderer;
switch (value) {
case "off":
session.setUseWrapMode(false);
renderer.setPrintMarginColumn(80);
break;
case "free":
session.setUseWrapMode(true);
session.setWrapLimitRange(null, null);
renderer.setPrintMarginColumn(80);
break;
default:
session.setUseWrapMode(true);
var col = parseInt(value, 10);
session.setWrapLimitRange(col, col);
renderer.setPrintMarginColumn(col);
}
});
bindCheckbox("select_style", function(checked) {
env.editor.setOption("selectionStyle", checked ? "line" : "text");
env.editor.setSelectionStyle(checked ? "line" : "text");
});
bindCheckbox("highlight_active", function(checked) {
@ -482,7 +487,7 @@ bindDropdown("split", function(value) {
sp.setSplits(1);
} else {
var newEditor = (sp.getSplits() == 1);
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
sp.setSplits(2);
if (newEditor) {
@ -526,12 +531,43 @@ bindCheckbox("highlight_token", function(checked) {
}
});
/************** dragover ***************************/
event.addListener(container, "dragover", function(e) {
var types = e.dataTransfer.types;
if (types && Array.prototype.indexOf.call(types, 'Files') !== -1)
return event.preventDefault(e);
});
event.addListener(container, "drop", function(e) {
var file;
try {
file = e.dataTransfer.files[0];
if (window.FileReader) {
var reader = new FileReader();
reader.onload = function() {
var mode = modelist.getModeForPath(file.name);
env.editor.session.doc.setValue(reader.result);
modeEl.value = mode.name;
env.editor.session.setMode(mode.mode);
env.editor.session.modeName = mode.name;
};
reader.readAsText(file);
}
return event.preventDefault(e);
} catch(err) {
return event.stopEvent(e);
}
});
var StatusBar = require("ace/ext/statusbar").StatusBar;
new StatusBar(env.editor, cmdLine.container);
var Emmet = require("ace/ext/emmet");
net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
net.loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
Emmet.setCore(window.emmet);
env.editor.setOption("enableEmmet", true);
});
@ -557,29 +593,35 @@ env.editSnippets = function() {
var text = m.snippetText;
var s = doclist.initDoc(text, "", {});
s.setMode("ace/mode/snippets");
doclist["snippets/" + id] = s;
doclist["snippets/" + id] = s
}
editor.on("blur", function() {
m.snippetText = editor.getValue();
snippetManager.unregister(m.snippets);
m.snippets = snippetManager.parseSnippetFile(m.snippetText, m.scope);
snippetManager.register(m.snippets);
});
})
sp.$editors[0].once("changeMode", function() {
sp.setSplits(1);
});
})
editor.setSession(doclist["snippets/" + id], 1);
editor.focus();
};
}
require("ace/ext/language_tools");
env.editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: false,
enableSnippets: true
});
var beautify = require("ace/ext/beautify");
env.editor.commands.addCommands(beautify.commands);
})
});
// allow easy access to ace in console, but not in ace code which uses strict
function isNonStrict() {
try { return !!arguments.callee.caller.caller }
catch(e){ return false }
}
window.__defineGetter__("ace", function(){ return isNonStrict() && env.editor });
window.__defineGetter__("editor", function(){ return isNonStrict() && env.editor });
window.__defineGetter__("session", function(){ return isNonStrict() && env.editor.session });
window.__defineGetter__("split", function(){ return isNonStrict() && env.split });

View file

@ -1,217 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
var dom = require("ace/lib/dom");
var Range = require("ace/range").Range;
function warn() {
var s = (new Error()).stack || "";
s = s.split("\n");
if (s[1] == "Error") s.shift(); // remove error description on chrome
s.shift(); // remove warn
s.shift(); // remove the getter
s = s.join("\n");
// allow easy access to ace in console, but not in ace code
if (!/at Object.InjectedScript.|@debugger eval|snippets:\/{3}|\(<anonymous>:\d+:\d+\)/.test(s)) {
console.error("trying to access to global variable");
}
}
function def(o, key, get) {
try {
Object.defineProperty(o, key, {
configurable: true,
get: get,
set: function(val) {
delete o[key];
o[key] = val;
}
});
} catch(e) {
console.error(e);
}
}
def(window, "ace", function(){ warn(); return window.env.editor });
def(window, "editor", function(){ warn(); return window.env.editor });
def(window, "session", function(){ warn(); return window.env.editor.session });
def(window, "split", function(){ warn(); return window.env.split });
def(window, "devUtil", function(){ warn(); return exports });
exports.showTextArea = function(argument) {
dom.importCssString("\
.ace_text-input {\
position: absolute;\
z-index: 10!important;\
width: 6em!important;\
height: 1em;\
opacity: 1!important;\
background: rgba(0, 92, 255, 0.11);\
border: none;\
font: inherit;\
padding: 0 1px;\
margin: 0 -1px;\
text-indent: 0em;\
}\
");
};
exports.addGlobals = function() {
window.oop = require("ace/lib/oop");
window.dom = require("ace/lib/dom");
window.Range = require("ace/range").Range;
window.Editor = require("ace/editor").Editor;
window.assert = require("ace/test/asyncjs/assert");
window.asyncjs = require("ace/test/asyncjs/async");
window.UndoManager = require("ace/undomanager").UndoManager;
window.EditSession = require("ace/edit_session").EditSession;
window.MockRenderer = require("ace/test/mockrenderer").MockRenderer;
window.EventEmitter = require("ace/lib/event_emitter").EventEmitter;
window.getSelection = getSelection;
window.setSelection = setSelection;
window.testSelection = testSelection;
};
function getSelection(editor) {
var data = editor.multiSelect.toJSON();
if (!data.length) data = [data];
data = data.map(function(x) {
var a, c;
if (x.isBackwards) {
a = x.end;
c = x.start;
} else {
c = x.end;
a = x.start;
}
return Range.comparePoints(a, c)
? [a.row, a.column, c.row, c.column]
: [a.row, a.column];
});
return data.length > 1 ? data : data[0];
}
function setSelection(editor, data) {
if (typeof data[0] == "number")
data = [data];
editor.selection.fromJSON(data.map(function(x) {
var start = {row: x[0], column: x[1]};
var end = x.length == 2 ? start : {row: x[2], column: x[3]};
var isBackwards = Range.comparePoints(start, end) > 0;
return isBackwards ? {
start: end,
end: start,
isBackwards: true
} : {
start: start,
end: end,
isBackwards: true
};
}));
}
function testSelection(editor, data) {
assert.equal(getSelection(editor) + "", data + "");
}
exports.recordTestCase = function() {
exports.addGlobals();
var editor = window.editor;
var testcase = window.testcase = [];
var assert;
testcase.push({
type: "setValue",
data: editor.getValue()
}, {
type: "setSelection",
data: getSelection(editor)
});
editor.commands.on("afterExec", function(e) {
testcase.push({
type: "exec",
data: e
});
testcase.push({
type: "value",
data: editor.getValue()
});
testcase.push({
type: "selection",
data: getSelection(editor)
});
});
editor.on("mouseup", function() {
testcase.push({
type: "setSelection",
data: getSelection(editor)
});
});
testcase.toString = function() {
var lastValue = "";
// var lastSelection = ""
var str = this.map(function(x) {
var data = x.data;
switch (x.type) {
case "exec":
return 'editor.execCommand("'
+ data.command.name
+ (data.args ? '", ' + JSON.stringify(data.args) : '"')
+ ')';
case "setSelection":
return 'setSelection(editor, ' + JSON.stringify(data) + ')';
case "setValue":
if (lastValue != data) {
lastValue = data;
return 'editor.setValue(' + JSON.stringify(data) + ', -1)';
}
return;
case "selection":
return 'testSelection(editor, ' + JSON.stringify(data) + ')';
case "value":
if (lastValue != data) {
lastValue = data;
return 'assert.equal('
+ 'editor.getValue(),'
+ JSON.stringify(data)
+ ')';
}
return;
}
}).filter(Boolean).join("\n");
return getSelection + "\n"
+ testSelection + "\n"
+ setSelection + "\n"
+ "\n" + str + "\n";
};
};
});

View file

@ -66,51 +66,106 @@ function makeHuge(txt) {
}
var docs = {
"docs/javascript.js": {order: 1, name: "JavaScript"},
"docs/javascript.js": "JavaScript",
"docs/AsciiDoc.asciidoc": "AsciiDoc",
"docs/clojure.clj": "Clojure",
"docs/coffeescript.coffee": "CoffeeScript",
"docs/coldfusion.cfm": "ColdFusion",
"docs/cpp.cpp": "C/C++",
"docs/csharp.cs": "C#",
"docs/css.css": "CSS",
"docs/curly.curly": "Curly",
"docs/dart.dart": "Dart",
"docs/diff.diff": "Diff",
"docs/dot.dot": "Dot",
"docs/freemarker.ftl" : "FreeMarker",
"docs/glsl.glsl": "Glsl",
"docs/golang.go": "Go",
"docs/groovy.groovy": "Groovy",
"docs/haml.haml": "Haml",
"docs/Haxe.hx": "haXe",
"docs/html.html": "HTML",
"docs/html_ruby.erb": "HTML (Ruby)",
"docs/jade.jade": "Jade",
"docs/java.java": "Java",
"docs/jsp.jsp": "JSP",
"docs/json.json": "JSON",
"docs/jsx.jsx": "JSX",
"docs/latex.tex": {name: "LaTeX", wrapped: true},
"docs/less.less": "LESS",
"docs/lisp.lisp": "Lisp",
"docs/lsl.lsl": "LSL",
"docs/scheme.scm": "Scheme",
"docs/livescript.ls": "LiveScript",
"docs/liquid.liquid": "Liquid",
"docs/logiql.logic": "LogiQL",
"docs/lua.lua": "Lua",
"docs/lucene.lucene": "Lucene",
"docs/luapage.lp": "LuaPage",
"docs/Makefile": "Makefile",
"docs/markdown.md": {name: "Markdown", wrapped: true},
"docs/mushcode.mc": {name: "MUSHCode", wrapped: true},
"docs/objectivec.m": {name: "Objective-C"},
"docs/ocaml.ml": "OCaml",
"docs/OpenSCAD.scad": "OpenSCAD",
"docs/pascal.pas": "Pascal",
"docs/perl.pl": "Perl",
"docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
"docs/php.php": "PHP",
"docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
"docs/powershell.ps1": "Powershell",
"docs/properties.properties": "Properties",
"docs/python.py": "Python",
"docs/r.r": "R",
"docs/rdoc.Rd": "RDoc",
"docs/rhtml.rhtml": "RHTML",
"docs/ruby.rb": "Ruby",
"docs/abap.abap": "SAP - ABAP",
"docs/scala.scala": "Scala",
"docs/scss.scss": "SCSS",
"docs/sass.sass": "SASS",
"docs/sh.sh": "SH",
"docs/space.space": "Space",
"docs/stylus.styl": "Stylus",
"docs/sql.sql": {name: "SQL", wrapped: true},
"docs/svg.svg": "SVG",
"docs/tcl.tcl": "Tcl",
"docs/tex.tex": "Tex",
"docs/textile.textile": {name: "Textile", wrapped: true},
"docs/snippets.snippets": "snippets",
"docs/toml.toml": "TOML",
"docs/typescript.ts": "Typescript",
"docs/vbscript.vbs": "VBScript",
"docs/velocity.vm": "Velocity",
"docs/xml.xml": "XML",
"docs/xquery.xq": "XQuery",
"docs/yaml.yaml": "YAML",
"docs/c9search.c9search_results": "C9 Search Results",
"docs/mel.mel": "MEL",
"docs/Nix.nix": "Nix"
"docs/actionscript.as": "ActionScript",
"docs/assembly_x86.asm": "Assembly_x86",
"docs/autohotkey.ahk": "AutoHotKey",
"docs/batchfile.bat": "BatchFile",
"docs/erlang.erl": "Erlang",
"docs/forth.frt": "Forth",
"docs/haskell.hs": "Haskell",
"docs/julia.js": "Julia",
"docs/prolog.plg": "Prolog",
"docs/rust.rs": "Rust",
"docs/twig.twig": "Twig",
"docs/Nix.nix": "Nix",
"docs/protobuf.proto": "Protobuf"
};
var ownSource = {
/* filled from require*/
};
var hugeDocs = require.toUrl ? {
var hugeDocs = {
"build/src/ace.js": "",
"build/src-min/ace.js": ""
} : {
"src/ace.js": "",
"src-min/ace.js": ""
};
modelist.modes.forEach(function(m) {
var ext = m.extensions.split("|")[0];
if (ext[0] === "^") {
path = ext.substr(1);
} else {
var path = m.name + "." + ext;
}
path = "docs/" + path;
if (!docs[path]) {
docs[path] = {name: m.caption};
} else if (typeof docs[path] == "object" && !docs[path].name) {
docs[path].name = m.caption;
}
});
if (window.require && window.require.s) try {
for (var path in window.require.s.contexts._.defined) {
if (path.indexOf("!") != -1)
@ -121,13 +176,6 @@ if (window.require && window.require.s) try {
}
} catch(e) {}
function sort(list) {
return list.sort(function(a, b) {
var cmp = (b.order || 0) - (a.order || 0);
return cmp || a.name && a.name.localeCompare(b.name);
});
}
function prepareDocList(docs) {
var list = [];
for (var path in docs) {
@ -169,44 +217,13 @@ function loadDoc(name, callback) {
});
}
function saveDoc(name, callback) {
var doc = fileCache[name] || name;
if (!doc || !doc.session)
return callback("Unknown document: " + name);
var path = doc.path;
var parts = path.split("/");
if (parts[0] == "docs")
path = "demo/kitchen-sink/" + path;
else if (parts[0] == "ace")
path = "lib/" + path;
upload(path, doc.session.getValue(), callback);
}
function upload(url, data, callback) {
url = net.qualifyURL(url);
if (!/https?:/.test(url))
return callback(new Error("Unsupported url scheme"));
var xhr = new XMLHttpRequest();
xhr.open("PUT", url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
callback(!/^2../.test(xhr.status));
}
};
xhr.send(data);
};
module.exports = {
fileCache: fileCache,
docs: sort(prepareDocList(docs)),
docs: prepareDocList(docs),
ownSource: prepareDocList(ownSource),
hugeDocs: prepareDocList(hugeDocs),
initDoc: initDoc,
loadDoc: loadDoc,
saveDoc: saveDoc,
loadDoc: loadDoc
};
module.exports.all = {
"Mode Examples": module.exports.docs,

View file

@ -1,11 +0,0 @@
# A sample .gitignore file.
.buildlog
.DS_Store
.svn
# Negated patterns:
!foo.bar
# Also ignore user settings...
/.settings

View file

@ -1,53 +0,0 @@
#
# example Dockerfile for http://docs.docker.io/en/latest/examples/postgresql_service/
#
FROM ubuntu
MAINTAINER SvenDowideit@docker.com
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
# of PostgreSQL, ``9.3``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
# Update the Ubuntu and PostgreSQL repository indexes
RUN apt-get update
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
RUN apt-get -y -q install python-software-properties software-properties-common
RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
# after each ``apt-get``
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
USER postgres
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
# then create a database `docker` owned by the ``docker`` role.
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
# allows the RUN command to span multiple lines.
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\
createdb -O docker docker
# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
# Expose the PostgreSQL port
EXPOSE 5432
# Add VOLUMEs to allow backup of config, logs and databases
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
# Set the default command to run when starting the container
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]

View file

@ -1,247 +0,0 @@
vars it, p
p = {label, value|
print("\n" + label)
print(inspect(value))
}
-- Create an array from 0 to 15
p("range", i-collect(range(5)))
-- Create an array from 0 to 15 and break up in chunks of 4
p("chunked range", i-collect(i-chunk(4, range(16))))
-- Check if all or none items in stream pass test.
p("all < 60 in range(60)", i-all?({i|i<60}, range(60)))
p("any < 60 in range(60)", i-any?({i|i>60}, range(60)))
p("all < 60 in range(70)", i-all?({i|i<60}, range(70)))
p("any < 60 in range(70)", i-any?({i|i>60}, range(70)))
-- Zip three different collections together
p("zipped", i-collect(i-zip(
range(10),
[1,2,3,4,5],
i-map({i|i*i}, range(10))
)))
vars names, person, i, doubles, lengths, cubeRange
names = ["Thorin", "Dwalin", "Balin", "Bifur", "Bofur", "Bombur", "Oin",
"Gloin", "Ori", "Nori", "Dori", "Fili", "Kili", "Bilbo", "Gandalf"]
for name in names {
if name != "Bilbo" && name != "Gandalf" {
print(name)
}
}
person = {name: "Tim", age: 30}
for key, value in person {
print(key + " = " + value)
}
i = 0
while i < 10 {
i = i + 1
print(i)
}
print("range")
for i in range(10) {
print(i + 1)
}
for i in range(10) {
print(10 - i)
}
-- Dynamic object that gives the first 10 doubles
doubles = {
@len: {| 10 }
@get: {key|
if key is Integer { key * key }
}
}
print("#doubles", #doubles)
print("Doubles")
for k, v in doubles {
print([k, v])
}
-- Dynamic object that has names list as keys and string lenth as values
lengths = {
@keys: {| names }
@get: {key|
if key is String { #key }
}
}
print ("Lengths")
for k, v in lengths {
print([k, v])
}
cubeRange = {n|
vars i, v
i = 0
{
@call: {|
v = i
i = i + 1
if v < n { v * v * v }
}
}
}
print("Cubes")
for k, v in cubeRange(5) {
print([k, v])
}
print("String")
for k, v in "Hello World" {
print([k, v])
}
print([i for i in range(10)])
print([i for i in range(20) if i % 3])
-- Example showing how to do parallel work using split..and
base = {bootstrap, target-dir|
split {
copy("res", target-dir)
} and {
if newer("src/*.less", target-dir + "/style.css") {
lessc("src/" + bootstrap + ".less", target-dir + "/style.css")
}
} and {
build("src/" + bootstrap + ".js", target-dir + "/app.js")
}
}
vars Dragon, pet
Dragon = {name|
vars asleep, stuff-in-belly, stuff-in-intestine,
feed, walk, put-to-bed, toss, rock,
hungry?, poopy?, passage-of-time
asleep = false
stuff-in-belly = 10 -- He's full.
stuff-in-intestine = 0 -- He doesn't need to go.
print(name + ' is born.')
feed = {|
print('You feed ' + name + '.')
stuff-in-belly = 10
passage-of-time()
}
walk = {|
print('You walk ' + name + ".")
stuff-in-intestine = 0
passage-of-time
}
put-to-bed = {|
print('You put ' + name + ' to bed.')
asleep = true
for i in range(3) {
if asleep {
passage-of-time()
}
if asleep {
print(name + ' snores, filling the room with smoke.')
}
}
if asleep {
asleep = false
print(name + ' wakes up slowly.')
}
}
toss = {|
print('You toss ' + name + ' up into the air.')
print('He giggles, which singes your eyebrows.')
passage-of-time()
}
rock = {|
print('You rock ' + name + ' gently.')
asleep = true
print('He briefly dozes off...')
passage-of-time()
if asleep {
asleep = false
print('...but wakes when you stop.')
}
}
hungry? = {|
stuff-in-belly <= 2
}
poopy? = {|
stuff-in-intestine >= 8
}
passage-of-time = {|
if stuff-in-belly > 0 {
-- Move food from belly to intestine
stuff-in-belly = stuff-in-belly - 1
stuff-in-intestine = stuff-in-intestine + 1
} else { -- Our dragon is starving!
if asleep {
asleep = false
print('He wakes up suddenly!')
}
print(name + ' is starving! In desperation, he ate YOU!')
abort "died"
}
if stuff-in-intestine >= 10 {
stuff-in-intestine = 0
print('Whoops! ' + name + ' had an accident...')
}
if hungry?() {
if asleep {
asleep = false
print('He wakes up suddenly!')
}
print(name + "'s stomach grumbles...")
}
if poopy?() {
if asleep {
asleep = false
print('He wakes up suddenly!')
}
print(name + ' does the potty dance...')
}
}
-- Export the public interface to this closure object.
{
feed: feed
walk: walk
put-to-bed: put-to-bed
toss: toss
rock: rock
}
}
pet = Dragon('Norbert')
pet.feed()
pet.toss()
pet.walk()
pet.put-to-bed()
pet.rock()
pet.put-to-bed()
pet.put-to-bed()
pet.put-to-bed()
pet.put-to-bed()

View file

@ -1,171 +0,0 @@
%abc-2.1
H:This file contains some example English tunes
% note that the comments (like this one) are to highlight usages
% and would not normally be included in such detail
O:England % the origin of all tunes is England
X:1 % tune no 1
T:Dusty Miller, The % title
T:Binny's Jig % an alternative title
C:Trad. % traditional
R:DH % double hornpipe
M:3/4 % meter
K:G % key
B>cd BAG|FA Ac BA|B>cd BAG|DG GB AG:|
Bdd gfg|aA Ac BA|Bdd gfa|gG GB AG:|
BG G/2G/2G BG|FA Ac BA|BG G/2G/2G BG|DG GB AG:|
W:Hey, the dusty miller, and his dusty coat;
W:He will win a shilling, or he spend a groat.
W:Dusty was the coat, dusty was the colour;
W:Dusty was the kiss, that I got frae the miller.
X:2
T:Old Sir Simon the King
C:Trad.
S:Offord MSS % from Offord manuscript
N:see also Playford % reference note
M:9/8
R:SJ % slip jig
N:originally in C % transcription note
K:G
D|GFG GAG G2D|GFG GAG F2D|EFE EFE EFG|A2G F2E D2:|
D|GAG GAB d2D|GAG GAB c2D|[1 EFE EFE EFG|[A2G] F2E D2:|\ % no line-break in score
M:12/8 % change of meter
[2 E2E EFE E2E EFG|\ % no line-break in score
M:9/8 % change of meter
A2G F2E D2|]
X:3
T:William and Nancy
T:New Mown Hay
T:Legacy, The
C:Trad.
O:England; Gloucs; Bledington % place of origin
B:Sussex Tune Book % can be found in these books
B:Mally's Cotswold Morris vol.1 2
D:Morris On % can be heard on this record
P:(AB)2(AC)2A % play the parts in this order
M:6/8
K:G
[P:A] D|"G"G2G GBd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
[P:B] d|"G"e2d B2d|"C"gfe "G"d2d| "G"e2d B2d|"C"gfe "D7"d2c|
"G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
% changes of meter, using inline fields
[T:Slows][M:4/4][L:1/4][P:C]"G"d2|"C"e2 "G"d2|B2 d2|"Em"gf "A7"e2|"D7"d2 "G"d2|\
"C"e2 "G"d2|[M:3/8][L:1/8] "G"B2 d |[M:6/8] "C"gfe "D7"d2c|
"G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
X:4
T:South Downs Jig
R:jig
S:Robert Harbron
M:6/8
L:1/8
K:G
|: d | dcA G3 | EFG AFE | DEF GAB | cde d2d |
dcA G3 | EFG AFE | DEF GAB | cAF G2 :|
B | Bcd e2c | d2B c2A | Bcd e2c | [M:9/8]d2B c2B A3 |
[M:6/8]DGF E3 | cBA FED | DEF GAB |1 cAF G2 :|2 cAF G3 |]
X:5
T:Atholl Brose
% in this example, which reproduces Highland Bagpipe gracing,
% the large number of grace notes mean that it is more convenient to be specific about
% score line-breaks (using the $ symbol), rather than using code line breaks to indicate them
I:linebreak $
K:D
{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
{gcd}c<{e}A {gAGAG}A>e {ag}a>f {gef}e>d|
{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
{g}c/d/e {g}G>{d}B {gf}gG {dc}d>B:|$
{g}c<e {gf}g>e {ag}a>e {gf}g>e|
{g}c<e {gf}g>e {ag}a2 {GdG}a>d|
{g}c<e {gf}g>e {ag}a>e {gf}g>f|
{gef}e>d {gf}g>d {gBd}B<{e}G {dc}d>B|
{g}c<e {gf}g>e {ag}a>e {gf}g>e|
{g}c<e {gf}g>e {ag}a2 {GdG}ad|
{g}c<{GdG}e {gf}ga {f}g>e {g}f>d|
{g}e/f/g {Gdc}d>c {gBd}B<{e}G {dc}d2|]
X:6
T:Untitled Reel
C:Trad.
K:D
eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|\
ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
K:G
AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|
X:7
T:Kitchen Girl
C:Trad.
K:D
[c4a4] [B4g4]|efed c2cd|e2f2 gaba|g2e2 e2fg|
a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
K:G
ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
ABAG EGAB|cBAc BAG2|A4 A4:|
%abc-2.1
%%pagewidth 21cm
%%pageheight 29.7cm
%%topspace 0.5cm
%%topmargin 1cm
%%botmargin 0cm
%%leftmargin 1cm
%%rightmargin 1cm
%%titlespace 0cm
%%titlefont Times-Bold 32
%%subtitlefont Times-Bold 24
%%composerfont Times 16
%%vocalfont Times-Roman 14
%%staffsep 60pt
%%sysstaffsep 20pt
%%musicspace 1cm
%%vocalspace 5pt
%%measurenb 0
%%barsperstaff 5
%%scale 0.7
X: 1
T: Canzonetta a tre voci
C: Claudio Monteverdi (1567-1643)
M: C
L: 1/4
Q: "Andante mosso" 1/4 = 110
%%score [1 2 3]
V: 1 clef=treble name="Soprano"sname="A"
V: 2 clef=treble name="Alto" sname="T"
V: 3 clef=bass middle=d name="Tenor" sname="B"
%%MIDI program 1 75 % recorder
%%MIDI program 2 75
%%MIDI program 3 75
K: Eb
% 1 - 4
[V: 1] |:z4 |z4 |f2ec |_ddcc |
w: Son que-sti~i cre-spi cri-ni~e
w: Que-sti son gli~oc-chi che mi-
[V: 2] |:c2BG|AAGc|(F/G/A/B/)c=A|B2AA |
w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e
w: Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-
[V: 3] |:z4 |f2ec|_ddcf |(B/c/_d/e/)ff|
w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il
w: Que-sti son~gli oc-chi che mi-ran - - - - do
% 5 - 9
[V: 1] cAB2 |cAAA |c3B|G2!fermata!Gz ::e4|
w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
w: ran-do fi-so, tut-to re-stai con-qui-so.
[V: 2] AAG2 |AFFF |A3F|=E2!fermata!Ez::c4|
w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
w: ran-do fi-so tut-to re-stai con-qui-so.
[V: 3] (ag/f/e2)|A_ddd|A3B|c2!fermata!cz ::A4|
w: vi - - - so ond' io ti-man-go~uc-ci-so. Deh,
w: fi - - - so tut-to re-stai con-qui-so.
% 10 - 15
[V: 1] f_dec |B2c2|zAGF |\
w: dim-me-lo ben mi-o, che que-sto\
=EFG2 |1F2z2:|2F8|] % more notes
w: sol de-si-o_. % more lyrics
[V: 2] ABGA |G2AA|GF=EF |(GF3/2=E//D//E)|1F2z2:|2F8|]
w: dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_.
[V: 3] _dBc>d|e2AF|=EFc_d|c4 |1F2z2:|2F8|]
w: dim-me-lo ben mi-o, che que-sto sol de-si-o_.

View file

@ -1,5 +0,0 @@
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line("Hello, world!");
end Hello;

View file

@ -1,4 +1,4 @@
Searching for var in/.c9/metadata/workspace/pluginsregexp, case sensitive, whole word
Searching for 'var' in /workspace/configs
configs/default.js:
1: var fs = require("fs");

View file

@ -1,42 +0,0 @@
-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,
set a (int 2)
print (self)
set c (child)
under c
under parent
print a
print $ get c a
set c x (int 3)
print $ get c x
set just-print $ code
print a
print just-print
eval (self) just-print
eval just-print
print (string "string with space")
print (string "escapes \n \"\\")
brackets ((((()))))
"eval" $ string "eval"
print (add $ (int 1) (int 2))
print $ unwrap $
map (a $ int 1) (b $ int 2)
print a
int 1
, b c
int 2
, d

View file

@ -1 +0,0 @@
TODO

View file

@ -1,18 +1,28 @@
.text-layer {
font: 12px Monaco, "Courier New", monospace;
font-family: Monaco, "Courier New", monospace;
font-size: 12pX;
cursor: text;
}
.blinker {
animation: blink 1s linear infinite alternate;
animation-duration: 1s;
animation-name: blink;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-timing-function: linear;
}
@keyframes blink {
0%, 40% {
0% {
opacity: 0;
}
40.5%, 100% {
40% {
opacity: 0;
}
40.5% {
opacity: 1
}
100% {
opacity: 1
}
}

View file

@ -1,14 +0,0 @@
#!/usr/bin/env rdmd
// Computes average line length for standard input.
import std.stdio;
void main() {
ulong lines = 0;
double sumLength = 0;
foreach (line; stdin.byLine()) {
++lines;
sumLength += line.length;
}
writeln("Average line length: ",
lines ? sumLength / lines : 0);
}

View file

@ -1,19 +1,58 @@
// Go ahead and modify this example.
import "dart:html";
// Computes the nth Fibonacci number.
int fibonacci(int n) {
if (n < 2) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
main() {
print('Hello World!');
}
// Displays a Fibonacci number.
void main() {
int i = 20;
String message = "fibonacci($i) = ${fibonacci(i)}";
// This example uses HTML to display the result and it will appear
// in a nested HTML frame (an iframe).
document.body.append(new HeadingElement.h1()..appendText(message));
int fib(int n) => (n > 1) ? (fib(n - 1) + fib(n - 2)) : n;
main() {
print('fib(20) = ${fib(20)}');
}
/*asd
asdad
*/
0.67
77
.86
import("http://dartwatch.com/myOtherLibrary.dart");
import("myOtherLibrary.dart", prefix:"lib1");
"""asdasdads
asdadsadsasd
asdasdasdad"""
'23424'
0x234
foo is bar
int x = 4 << 10
// Create a class for Point.
class Point {
// Final variables cannot be changed once they are assigned.
// Create two instance variables.
final num x, y;
// A constructor, with syntactic sugar for setting instance variables.
Point(this.x, this.y);
// A named constructor with an initializer list.
Point.origin() : x = 0, y = 0;
// A method.
num distanceTo(Point other) {
var dx = x - other.x;
var dy = y - other.y;
return sqrt(dx * dx + dy * dy);
}
}
// Check for null.
var unicorn;
assert(unicorn == null);
// Check for NaN.
var iMeantToDoThis = 0/0;
assert(iMeantToDoThis.isNaN());

View file

@ -1,30 +0,0 @@
note
description: "Represents a person."
class
PERSON
create
make, make_unknown
feature {NONE} -- Creation
make (a_name: like name)
-- Create a person with `a_name' as `name'.
do
name := a_name
ensure
name = a_name
end
make_unknown
do ensure
name = Void
end
feature -- Access
name: detachable STRING
-- Full name or Void if unknown.
end

View file

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Cloud9 Rocks!</title>
</head>
<body>
<table class="table">
<tr>
<th>Name</th>
<th>Size</th>
</tr>
<% if (!isRoot) { %>
<tr>
<td><a href="..">..</a></td>
<td></td></td>
</tr>
<% } %>
<% entries.forEach(function(entry) { %>
<tr>
<td>
<span class="glyphicon <%= entry.mime == 'directory' ? 'folder': 'file'%>"></span>
<a href="<%= entry.name %>"><%= entry.name %></a>
</td>
<td><%= entry.size %></td>
</tr>
<% }) %>
</table>
</body>
</html>

View file

@ -1,42 +0,0 @@
defmodule HelloModule do
@moduledoc """
This is supposed to be `markdown`.
__Yes__ this is [mark](http://down.format)
# Truly
## marked
* with lists
* more
* and more
Even.with(code)
blocks |> with |> samples
_Docs are first class citizens in Elixir_ (Jose Valim)
"""
# A "Hello world" function
def some_fun do
IO.puts "Juhu Kinners!"
end
# A private function
defp priv do
is_regex ~r"""
This is a regex
spanning several
lines.
"""
x = elem({ :a, :b, :c }, 0) #=> :a
end
end
test_fun = fn(x) ->
cond do
x > 10 ->
:greater_than_ten
true ->
:maybe_ten
end
end

View file

@ -1,12 +0,0 @@
{- Ace {- 4 -} Elm -}
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)

View file

@ -1,31 +0,0 @@
O003 (DIAMOND SQUARE)
N2 G54 G90 G49 G80
N3 M6 T1 (1.ENDMILL)
N4 M3 S1800
N5 G0 X-.6 Y2.050
N6 G43 H1 Z.1
N7 G1 Z-.3 F50.
N8 G41 D1 Y1.45
N9 G1 X0 F20.
N10 G2 J-1.45
(CUTTER COMP CANCEL)
N11 G1 Z-.2 F50.
N12 Y-.990
N13 G40
N14 G0 X-.6 Y1.590
N15 G0 Z.1
N16 M5 G49 G28 G91 Z0
N17 CALL O9456
N18 #500=0.004
N19 #503=[#500+#501]
N20 VC45=0.0006
VS4=0.0007
N21 G90 G10 L20 P3 X5.Y4. Z6.567
N22 G0 X5000
N23 IF [#1 LT 0.370] GOTO 49
N24 X-0.678 Y+.990
N25 G84.3 X-0.1
N26 #4=#5*COS[45]
N27 #4=#5*SIN[45]
N28 VZOFZ=652.9658
%

View file

@ -1,28 +0,0 @@
@these @are @tags
Feature: Serve coffee
Coffee should not be served until paid for
Coffee should not be served until the button has been pressed
If there is no coffee left then money should be refunded
Scenario Outline: Eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
Scenario: Buy last coffee
Given there are 1 coffees left in the machine
And I have deposited 1$
When I press the coffee button
Then I should be served a "coffee"
# this a comment
"""
this is a
pystring
"""

View file

@ -1,8 +0,0 @@
{{!-- Ace + :-}} --}}
<div id="comments">
{{#each comments}}
<h2><a href="/posts/{{../permalink}}#{{id}}">{{title}}</a></h2>
<div>{{{body}}}</div>
{{/each}}
</div>

View file

@ -1,10 +0,0 @@
Redirect /linux http://www.linux.org
Redirect 301 /kernel http://www.linux.org
# comment
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*
RewriteRule ^/$ /homepage.max.html [L]
RewriteRule ^/$ /homepage.std.html [L]

View file

@ -1,4 +0,0 @@
[.ShellClassInfo]
IconResource=..\logo.png
[ViewState]
FolderType=Generic

View file

@ -1,6 +0,0 @@
// computes factorial of a number
factorial := method(n,
if(n == 0, return 1)
res := 1
Range 1 to(n) foreach(i, res = res * i)
)

View file

@ -1 +0,0 @@
TODO

View file

@ -2,7 +2,7 @@ for op = (:+, :*, :&, :|, :$)
@eval ($op)(a,b,c) = ($op)(($op)(a,b),c)
end
v = α';
function g(x,y)
return x * y
x + y

View file

@ -1,9 +0,0 @@
import logic
section
variables (A : Type) (p q : A Prop)
example : (x : A, p x q x) y : A, p y :=
assume H : x : A, p x q x,
take y : A,
show p y, from and.elim_left (H y)
end

View file

@ -8,7 +8,7 @@ integer someIntNormal = 3672;
integer someIntHex = 0x00000000;
integer someIntMath = PI_BY_TWO;
integer event = 5673; // invalid.illegal
integer event = 5673; // unimplemented reserved keyword!
key someKeyTexture = TEXTURE_DEFAULT;
string someStringSpecial = EOF;
@ -53,12 +53,12 @@ default
someIntHex = 0x00000000;
someIntMath = PI_BY_TWO;
event = 5673; // invalid.illegal
event = 5673; // unimplemented reserved keyword!
someKeyTexture = TEXTURE_DEFAULT;
someStringSpecial = EOF;
llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL); // reserved.godmode
llCloud(ZERO_VECTOR); // invalid deprecated function!
llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now...");
state other;

View file

@ -1,52 +0,0 @@
/* Mask Syntax Demo */
div > ' Test ~[name]';
define :userProfile {
header {
h4 > @title;
button.close;
}
}
:userProfile {
@title > ' Hello ~[: username.toUpperCase()]'
}
style {
html, body {
background: url('name.png') 0 0 no-repeat;
}
}
button {
event click (e) {
this.textContent = `name ${e.clientX} !`;
}
}
md > """
- div
- span
Hello
[one](http://google.com)
""";
header .foo > 'Heading'
button .baz x-signal='click: test' disabled > "
Hello,
world
\"Buddy\"
"
var a = {
name: `name ${window.innerWidth}`
};
span .foo > "~[bind: a.name]"

View file

@ -1,17 +0,0 @@
%{
%{
Ace Matlab demo
%}
%}
classdef hello
methods
function greet(this)
disp('Hello!') % say hi
end
end
end
% transpose
a = [ 'x''y', "x\n\
y", 1' ]' + 2'

View file

@ -1,33 +0,0 @@
// animated duplicates, instances script
proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance)
{
int $range_start = $rangeStart;
int $range_end = $rangeEnd;
int $num_of_duplicates = $numOfDuplicates;
int $step_size = ($range_end - $range_start) / $num_of_duplicates;
int $i = 0;
int $temp;
currentTime $range_start; // set to range start
string $selectedObjects[]; // to store selected objects
$selectedObjects = `ls -sl`; // store selected objects
select $selectedObjects;
while ($i <= $num_of_duplicates)
{
$temp = $range_start + ($step_size * $i);
currentTime ($temp);
// seleced the objects to duplicate or instance
select $selectedObjects;
if($duplicateOrInstance == 0)
{
duplicate;
}
else
{
instance;
}
$i++;
}
}

View file

@ -1 +0,0 @@
TODO

View file

@ -41,8 +41,8 @@ SELECT city, temp_lo, temp_hi, prcp, "date", location
/**
* Dollar quotes starting at the end of the line are colored as SQL unless
* a special language tag is used. Dollar quote syntax coloring is implemented
* for Perl, Python, JavaScript, and Json.
* a special language tag is used. Pearl and Python are currently implemented
* but lots of others are possible.
*/
create or replace function blob_content_chunked(
in p_data bytea,
@ -82,24 +82,6 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS $python$
SD["plan"] = plan
$python$ LANGUAGE plpythonu;
-- pl/v8 (javascript)
CREATE FUNCTION plv8_test(keys text[], vals text[]) RETURNS text AS $javascript$
var o = {};
for(var i=0; i<keys.length; i++){
o[keys[i]] = vals[i];
}
return JSON.stringify(o);
$javascript$ LANGUAGE plv8 IMMUTABLE STRICT;
-- json
select * from json_object_keys($json$
{
"f1": 5,
"f2": "test",
"f3": {}
}
$json$);
-- psql commands
\df cash*

View file

@ -1,148 +0,0 @@
form Highlighter test
sentence My_sentence This should all be a string
text My_text This should also all be a string
word My_word Only the first word is a string, the rest is invalid
boolean Binary 1
boolean Text no
boolean Quoted "yes"
comment This should be a string
real left_Range -123.6
positive right_Range_max 3.3
integer Int 4
natural Nat 4
endform
# External scripts
include /path/to/file
runScript: "/path/to/file"
execute /path/to/file
stopwatch
# old-style procedure call
call oldStyle "quoted" 2 unquoted string
assert oldStyle.local = 1
# New-style procedure call with parens
@newStyle("quoted", 2, "quoted string")
if praatVersion >= 5364
# New-style procedure call with colon
@newStyle: "quoted", 2, "quoted string"
endif
# if-block with built-in variables
if windows
# We are on Windows
elsif unix = 1 or !macintosh
exitScript: "We are on Linux"
else macintosh == 1
exit We are on Mac
endif
# inline if with inline comment
var = if macintosh = 1 then 0 else 1 fi ; This is an inline comment
# for-loop with explicit from using local variable
# and paren-style function calls and variable interpolation
n = numberOfSelected("Sound")
for i from newStyle.local to n
sound'i' = selected("Sound", i)
sound[i] = sound'i'
endfor
for i from 1 to n
# Different styles of object selection
select sound'i'
sound = selected()
sound$ = selected$("Sound")
select Sound 'sound$'
selectObject(sound[i])
selectObject: sound
# Pause commands
beginPause("Viewing " + sound$)
if i > 1
button = endPause("Stop", "Previous",
...if i = total_sounds then "Finish" else "Next" fi,
...3, 1)
else
button = endPause("Stop",
...if i = total_sounds then "Finish" else "Next" fi,
...2, 1)
endif
editor_name$ = if total_textgrids then "TextGrid " else "Sound " fi + name$
nocheck editor 'editor_name$'
nocheck Close
nocheck endeditor
# New-style standalone command call
Rename: "SomeName"
# Command call with assignment
duration = Get total duration
# Multi-line command with modifier
pitch = noprogress To Pitch (ac): 0, 75, 15, "no",
...0.03, 0.45, 0.01, 0.35, 0.14, 600
# do-style command with assignment
minimum = do("Get minimum...", 0, 0, "Hertz", "Parabolic")
# New-style multi-line command call with broken strings
table = Create Table with column names: "table", 0,
..."file subject speaker
...f0 f1 f2 f3 " +
..."duration response"
removeObject: pitch, table
# Picture window commands
selectObject: sound
# do-style command
do("Select inner viewport...", 1, 6, 0.5, 1.5)
Black
Draw... 0 0 0 0 "no" Curve
Draw inner box
Text bottom: "yes", sound$
Erase all
# Demo window commands
demo Erase all
demo Select inner viewport... 0 100 0 100
demo Axes... 0 100 0 100
demo Paint rectangle... white 0 100 0 100
demo Text... 50 centre 50 half Click to finish
demoWaitForInput ( )
demo Erase all
demo Text: 50, "centre", 50, "half", "Finished"
endfor
# An old-style sendpraat block
sendpraat Praat
...'newline$' Create Sound as pure tone... "tone" 1 0 0.4 44100 440 0.2 0.01 0.01
...'newline$' Play
...'newline$' Remove
# A new-style sendpraat block
beginSendPraat: "Praat"
Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
duration = Get total duration
Remove
endSendPraat: "duration"
appendInfoLine: "The generated sound lasted for ", duration, "seconds"
time = stopwatch
clearinfo
echo This script took
print 'time' seconds to
printline execute.
# Old-style procedure declaration
procedure oldStyle .str1$ .num .str2$
.local = 1
endproc
# New-style procedure declaration
procedure newStyle (.str1$, .num, .str2$)
.local = 1
endproc

View file

@ -20,7 +20,7 @@ class Range
end
end
{:id => ?", :key => "value"}
{:id => 34, :key => "value"}
herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment

View file

@ -2,9 +2,9 @@
# Script to open a browser to current branch
# Repo formats:
# ssh git@github.com:richo/gh_pr.git
# http https://richoH@github.com/richo/gh_pr.git
# git git://github.com/richo/gh_pr.git
# ssh git@github.com:richoH/gh_pr.git
# http https://richoH@github.com/richoH/gh_pr.git
# git git://github.com/richoH/gh_pr.git
username=`git config --get github.user`

View file

@ -1,28 +0,0 @@
var { each, map } = require('sjs:sequence');
var { get } = require('sjs:http');
function foo(items, nada) {
var component = { name: "Ace", role: "Editor" };
console.log("
Welcome, #{component.name}
".trim());
logging.debug(`Component added: $String(component) (${component})`);
console.log(`
Welcome, {${function() {
return { x: 1, y: "why?}"};
}()}
`.trim());
waitfor {
items .. each.par { |item|
get(item);
}
} and {
var lengths = items .. map(i -> i.length);
} or {
hold(1500);
throw new Error("timed out");
}
} // Real Tab.

View file

@ -1,7 +0,0 @@
{foreach $foo as $bar}
<a href="{$bar.zig}">{$bar.zag}</a>
<a href="{$bar.zig2}">{$bar.zag2}</a>
<a href="{$bar.zig3}">{$bar.zag3}</a>
{foreachelse}
There were no rows found.
{/foreach}

View file

@ -1,46 +0,0 @@
/**
* Greets a person using "Hello" by default.
* @param name The name of the person.
* @param? greetingWord Optional greeting word to use instead of "Hello".
*/
{template .helloName #eee}
{if not $greetingWord}
Hello {$name}!
{else}
{$greetingWord} {$name}!
{/if}
{/template}
/**
* Greets a person and optionally a list of other people.
* @param name The name of the person.
* @param additionalNames The additional names to greet. May be an empty list.
*/
{template .helloNames}
// Greet the person.
{call .helloName data="all" /}<br>
// Greet the additional people.
{foreach $additionalName in $additionalNames}
{call .helloName}
{param name: $additionalName /}
{/call}
{if not isLast($additionalName)}
<br> // break after every line except the last
{/if}
{ifempty}
No additional people to greet.
{/foreach}
{/template}
{/foreach}
{if length($items) > 5}
{msg desc="Says hello to the user."}
{namespace ns autoescape="contextual"}
/** Example. */
{template .example}
foo is {$ij.foo}
{/template}

View file

@ -1,72 +0,0 @@
-- =============================================
-- Author: Morgan Yarbrough
-- Create date: 4/27/2015
-- Description: Test procedure that shows off language features.
-- Includes non-standard folding with region comments using either
-- line comments or block comments (both are demonstrated below).
-- This mode imitates SSMS and it designed to be used with SQL Server theme.
-- =============================================
CREATE PROCEDURE dbo.TestProcedure
--#region parameters
@vint INT = 1
,@vdate DATE = NULL
,@vdatetime DATETIME = DATEADD(dd, 1, GETDATE())
,@vvarchar VARCHAR(MAX) = ''
--#endregion
AS
BEGIN
/*#region set statements */
SET NOCOUNT ON;
SET XACT_ABORT ON;
SET QUOTED_IDENTIFIER ON;
/*#endregion*/
/**
* These comments will produce a fold widget
*/
-- folding demonstration
SET @vint = CASE
WHEN @vdate IS NULL
THEN 1
ELSE 2
END
-- another folding demonstration
IF @vint = 1
BEGIN
SET @vvarchar = 'one'
SET @vint = DATEDIFF(dd, @vdate, @vdatetime)
END
-- this mode handles strings properly
DECLARE @sql NVARCHAR(4000) = N'SELECT TOP(1) OrderID
FROM Orders
WHERE @OrderDate > GETDATE()'
-- this mode is aware of built in stored procedures
EXECUTE sp_executesql @sql
-- demonstrating some syntax highlighting
SELECT Orders.OrderID
,Customers.CompanyName
,DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear
FROM Orders
INNER JOIN Customers
ON Orders.CustomerID = Customers.CustomerID
WHERE CompanyName NOT LIKE '%something'
OR CompanyName IS NULL
OR CompanyName IN ('bla', 'nothing')
-- this mode includes snippets
-- place your cusor at the end of the line below and trigger auto complete (Ctrl+Space)
createpr
-- SQL Server allows using keywords as object names (not recommended) as long as they are wrapped in brackets
DATABASE -- keyword
[DATABASE] -- not a keyword
END

View file

@ -1,21 +0,0 @@
using Gtk;
int main (string[] args) {
Gtk.init (ref args);
var foo = new MyFoo<string[](), MyBar<string, int>>();
var window = new Window();
window.title = "Hello, World!";
window.border_width = 10;
window.window_position = WindowPosition.CENTER;
window.set_default_size(350, 70);
window.destroy.connect(Gtk.main_quit);
var label = new Label("Hello, World!");
window.add(label);
window.show_all();
Gtk.main();
return 0;
}

View file

@ -1,12 +0,0 @@
always @(negedge reset or posedge clk) begin
if (reset == 0) begin
d_out <= 16'h0000;
d_out_mem[resetcount] <= d_out;
laststoredvalue <= d_out;
end else begin
d_out <= d_out + 1'b1;
end
end
always @(bufreadaddr)
bufreadval = d_out_mem[bufreadaddr];

View file

@ -1,34 +0,0 @@
library IEEE
user IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity COUNT16 is
port (
cOut :out std_logic_vector(15 downto 0); -- counter output
clkEn :in std_logic; -- count enable
clk :in std_logic; -- clock input
rst :in std_logic -- reset input
);
end entity;
architecture count_rtl of COUNT16 is
signal count :std_logic_vector (15 downto 0);
begin
process (clk, rst) begin
if(rst = '1') then
count <= (others=>'0');
elsif(rising_edge(clk)) then
if(clkEn = '1') then
count <= count + 1;
end if;
end if;
end process;
cOut <= count;
end architecture;

View file

@ -1,73 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
var config = require("ace/config");
var event = require("ace/lib/event");
var modelist = require("ace/ext/modelist");
module.exports = function(editor) {
event.addListener(editor.container, "dragover", function(e) {
var types = e.dataTransfer.types;
if (types && Array.prototype.indexOf.call(types, 'Files') !== -1)
return event.preventDefault(e);
});
event.addListener(editor.container, "drop", function(e) {
var file;
try {
file = e.dataTransfer.files[0];
if (window.FileReader) {
var reader = new FileReader();
reader.onload = function() {
var mode = modelist.getModeForPath(file.name);
editor.session.doc.setValue(reader.result);
editor.session.setMode(mode.mode);
editor.session.modeName = mode.name;
};
reader.readAsText(file);
}
return event.preventDefault(e);
} catch(err) {
return event.stopEvent(e);
}
});
};
var Editor = require("ace/editor").Editor;
config.defineOptions(Editor.prototype, "editor", {
loadDroppedFile: {
set: function() { module.exports(this); },
value: true
}
});
});

View file

@ -1,102 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
"use strict";
var LineWidgets = require("ace/line_widgets").LineWidgets;
var Editor = require("ace/editor").Editor;
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var dom = require("ace/lib/dom");
require("ace/commands/default_commands").commands.push({
name: "openInlineEditor",
bindKey: "F3",
exec: function(editor) {
var split = window.env.split;
var s = editor.session;
var inlineEditor = new Editor(new Renderer());
var splitSession = split.$cloneSession(s);
var row = editor.getCursorPosition().row;
if (editor.session.lineWidgets && editor.session.lineWidgets[row]) {
editor.session.lineWidgets[row].destroy();
return;
}
var rowCount = 10;
var w = {
row: row,
// rowCount: rowCount,
fixedWidth: true,
el: dom.createElement("div"),
editor: inlineEditor
};
var el = w.el;
el.appendChild(inlineEditor.container);
if (!editor.session.widgetManager) {
editor.session.widgetManager = new LineWidgets(editor.session);
editor.session.widgetManager.attach(editor);
}
var h = rowCount*editor.renderer.layerConfig.lineHeight;
inlineEditor.container.style.height = h + "px";
el.style.position = "absolute";
el.style.zIndex = "4";
el.style.borderTop = "solid blue 2px";
el.style.borderBottom = "solid blue 2px";
inlineEditor.setSession(splitSession);
editor.session.widgetManager.addLineWidget(w);
var kb = {
handleKeyboard:function(_,hashId, keyString) {
if (hashId === 0 && keyString === "esc") {
w.destroy();
return true;
}
}
};
w.destroy = function() {
editor.keyBinding.removeKeyboardHandler(kb);
s.widgetManager.removeLineWidget(w);
};
editor.keyBinding.addKeyboardHandler(kb);
inlineEditor.keyBinding.addKeyboardHandler(kb);
inlineEditor.setTheme("ace/theme/solarized_light");
}
});
});

View file

@ -116,6 +116,7 @@ exports.singleLineEditor = function(el) {
renderer.setStyle("ace_one-line");
var editor = new Editor(renderer);
new MultiSelect(editor);
editor.session.setUndoManager(new UndoManager());
editor.setShowPrintMargin(false);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

View file

@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.11+ Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* @license RequireJS 2.1.8+ Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
@ -12,7 +12,7 @@ var requirejs, require, define;
(function (global) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.11+',
version = '2.1.8+',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
@ -22,7 +22,7 @@ var requirejs, require, define;
hasOwn = op.hasOwnProperty,
ap = Array.prototype,
apsp = ap.splice,
isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is 'loading', 'loaded', execution,
@ -108,10 +108,7 @@ var requirejs, require, define;
if (source) {
eachProp(source, function (value, prop) {
if (force || !hasProp(target, prop)) {
if (deepStringMixin && typeof value === 'object' && value &&
!isArray(value) && !isFunction(value) &&
!(value instanceof RegExp)) {
if (deepStringMixin && typeof value !== 'string') {
if (!target[prop]) {
target[prop] = {};
}
@ -141,7 +138,7 @@ var requirejs, require, define;
throw err;
}
//Allow getting a global that is expressed in
//Allow getting a global that expressed in
//dot notation, like 'a.b.c'.
function getGlobal(value) {
if (!value) {
@ -180,7 +177,7 @@ var requirejs, require, define;
if (typeof requirejs !== 'undefined') {
if (isFunction(requirejs)) {
//Do not overwrite an existing requirejs instance.
//Do not overwrite and existing requirejs instance.
return;
}
cfg = requirejs;
@ -204,7 +201,6 @@ var requirejs, require, define;
waitSeconds: 7,
baseUrl: './',
paths: {},
bundles: {},
pkgs: {},
shim: {},
config: {}
@ -218,7 +214,6 @@ var requirejs, require, define;
defQueue = [],
defined = {},
urlFetched = {},
bundlesMap = {},
requireCounter = 1,
unnormalizedCounter = 1;
@ -232,8 +227,8 @@ var requirejs, require, define;
* @param {Array} ary the array of path segments.
*/
function trimDots(ary) {
var i, part, length = ary.length;
for (i = 0; i < length; i++) {
var i, part;
for (i = 0; ary[i]; i += 1) {
part = ary[i];
if (part === '.') {
ary.splice(i, 1);
@ -266,7 +261,7 @@ var requirejs, require, define;
* @returns {String} normalized name
*/
function normalize(name, baseName, applyMap) {
var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
foundMap, foundI, foundStarMap, starI,
baseParts = baseName && baseName.split('/'),
normalizedBaseParts = baseParts,
@ -279,26 +274,29 @@ var requirejs, require, define;
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
name = name.split('/');
lastIndex = name.length - 1;
// If wanting node ID compatibility, strip .js from end
// of IDs. Have to do this here, and not in nameToUrl
// because node allows either .js or non .js to map
// to same file.
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
if (getOwn(config.pkgs, baseName)) {
//If the baseName is a package name, then just treat it as one
//name to concat the name with.
normalizedBaseParts = baseParts = [baseName];
} else {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
}
name = normalizedBaseParts.concat(name);
name = normalizedBaseParts.concat(name.split('/'));
trimDots(name);
//Some use of packages may use a . path to reference the
//'main' module name, so normalize for that.
pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
name = name.join('/');
if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
name = pkgName;
}
} else if (name.indexOf('./') === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
@ -310,7 +308,7 @@ var requirejs, require, define;
if (applyMap && map && (baseParts || starMap)) {
nameParts = name.split('/');
outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
for (i = nameParts.length; i > 0; i -= 1) {
nameSegment = nameParts.slice(0, i).join('/');
if (baseParts) {
@ -327,12 +325,16 @@ var requirejs, require, define;
//Match, update name to the new value.
foundMap = mapValue;
foundI = i;
break outerLoop;
break;
}
}
}
}
if (foundMap) {
break;
}
//Check for a star map match, but just hold on to it,
//if there is a shorter segment match later in a matching
//config, then favor over this star map.
@ -353,11 +355,7 @@ var requirejs, require, define;
}
}
// If the name points to a package's name, use
// the package main instead.
pkgMain = getOwn(config.pkgs, name);
return pkgMain ? pkgMain : name;
return name;
}
function removeScript(name) {
@ -375,17 +373,12 @@ var requirejs, require, define;
function hasPathFallback(id) {
var pathConfig = getOwn(config.paths, id);
if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
removeScript(id);
//Pop off the first array value, since it failed, and
//retry
pathConfig.shift();
context.require.undef(id);
//Custom require that does not do map translation, since
//ID is "absolute", already mapped/resolved.
context.makeRequire(null, {
skipMap: true
})([id]);
context.require([id]);
return true;
}
}
@ -556,7 +549,7 @@ var requirejs, require, define;
//local var ref to defQueue, so cannot just reassign the one
//on context.
apsp.apply(defQueue,
[defQueue.length, 0].concat(globalDefQueue));
[defQueue.length - 1, 0].concat(globalDefQueue));
globalDefQueue = [];
}
}
@ -573,7 +566,7 @@ var requirejs, require, define;
mod.usingExports = true;
if (mod.map.isDefine) {
if (mod.exports) {
return (defined[mod.map.id] = mod.exports);
return mod.exports;
} else {
return (mod.exports = defined[mod.map.id] = {});
}
@ -587,9 +580,15 @@ var requirejs, require, define;
id: mod.map.id,
uri: mod.map.url,
config: function () {
return getOwn(config.config, mod.map.id) || {};
var c,
pkg = getOwn(config.pkgs, mod.map.id);
// For packages, only support config targeted
// at the main module.
c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
getOwn(config.config, mod.map.id);
return c || {};
},
exports: mod.exports || (mod.exports = {})
exports: defined[mod.map.id]
});
}
}
@ -630,7 +629,7 @@ var requirejs, require, define;
}
function checkLoaded() {
var err, usingPathFallback,
var map, modId, err, usingPathFallback,
waitInterval = config.waitSeconds * 1000,
//It is possible to disable the wait interval by using waitSeconds of 0.
expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
@ -648,8 +647,8 @@ var requirejs, require, define;
//Figure out the state of all the modules.
eachProp(enabledRegistry, function (mod) {
var map = mod.map,
modId = map.id;
map = mod.map;
modId = map.id;
//Skip things that are not enabled or in error state.
if (!mod.enabled) {
@ -872,14 +871,17 @@ var requirejs, require, define;
exports = context.execCb(id, factory, depExports, exports);
}
// Favor return value over exports. If node/cjs in play,
// then will not have a return value anyway. Favor
// module.exports assignment over exports object.
if (this.map.isDefine && exports === undefined) {
if (this.map.isDefine) {
//If setting exports via 'module' is in play,
//favor that over return value and exports. After that,
//favor a non-undefined return value over exports use.
cjsModule = this.module;
if (cjsModule) {
if (cjsModule &&
cjsModule.exports !== undefined &&
//Make sure it is not already the exports value
cjsModule.exports !== this.exports) {
exports = cjsModule.exports;
} else if (this.usingExports) {
} else if (exports === undefined && this.usingExports) {
//exports already set the defined value.
exports = this.exports;
}
@ -939,7 +941,6 @@ var requirejs, require, define;
on(pluginMap, 'defined', bind(this, function (plugin) {
var load, normalizedMap, normalizedMod,
bundleId = getOwn(bundlesMap, this.map.id),
name = this.map.name,
parentName = this.map.parentMap ? this.map.parentMap.name : null,
localRequire = context.makeRequire(map.parentMap, {
@ -985,14 +986,6 @@ var requirejs, require, define;
return;
}
//If a paths config, then just load that file instead to
//resolve the plugin, as it is built into that paths layer.
if (bundleId) {
this.map.url = context.nameToUrl(bundleId);
this.load();
return;
}
load = bind(this, function (value) {
this.init([], function () { return value; }, null, {
enabled: true
@ -1257,38 +1250,31 @@ var requirejs, require, define;
}
}
//Save off the paths since they require special processing,
//Save off the paths and packages since they require special processing,
//they are additive.
var shim = config.shim,
var pkgs = config.pkgs,
shim = config.shim,
objs = {
paths: true,
bundles: true,
config: true,
map: true
};
eachProp(cfg, function (value, prop) {
if (objs[prop]) {
if (!config[prop]) {
config[prop] = {};
if (prop === 'map') {
if (!config.map) {
config.map = {};
}
mixin(config[prop], value, true, true);
} else {
mixin(config[prop], value, true);
}
mixin(config[prop], value, true, true);
} else {
config[prop] = value;
}
});
//Reverse map the bundles
if (cfg.bundles) {
eachProp(cfg.bundles, function (value, prop) {
each(value, function (v) {
if (v !== prop) {
bundlesMap[v] = prop;
}
});
});
}
//Merge shim
if (cfg.shim) {
eachProp(cfg.shim, function (value, id) {
@ -1309,25 +1295,29 @@ var requirejs, require, define;
//Adjust packages if necessary.
if (cfg.packages) {
each(cfg.packages, function (pkgObj) {
var location, name;
var location;
pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
name = pkgObj.name;
location = pkgObj.location;
if (location) {
config.paths[name] = pkgObj.location;
}
//Save pointer to main module ID for pkg name.
//Remove leading dot in main, so main paths are normalized,
//and remove any trailing .js, since different package
//envs have different conventions: some use a module name,
//some use a file name.
config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
.replace(currDirRegExp, '')
.replace(jsSuffixRegExp, '');
//Create a brand new object on pkgs, since currentPackages can
//be passed in again, and config.pkgs is the internal transformed
//state for all package configs.
pkgs[pkgObj.name] = {
name: pkgObj.name,
location: location || pkgObj.name,
//Remove leading dot in main, so main paths are normalized,
//and remove any trailing .js, since different package
//envs have different conventions: some use a module name,
//some use a file name.
main: (pkgObj.main || 'main')
.replace(currDirRegExp, '')
.replace(jsSuffixRegExp, '')
};
});
//Done with modifications, assing packages back to context config
config.pkgs = pkgs;
}
//If there are any "waiting to execute" modules in the registry,
@ -1474,21 +1464,10 @@ var requirejs, require, define;
var map = makeModuleMap(id, relMap, true),
mod = getOwn(registry, id);
removeScript(id);
delete defined[id];
delete urlFetched[map.url];
delete undefEvents[id];
//Clean queued defines too. Go backwards
//in array so that the splices do not
//mess up the iteration.
eachReverse(defQueue, function(args, i) {
if(args[0] === id) {
defQueue.splice(i, 1);
}
});
if (mod) {
//Hold on to listeners in case the
//module will be attempted to be reloaded
@ -1508,7 +1487,7 @@ var requirejs, require, define;
/**
* Called to enable a module if it is still in the registry
* awaiting enablement. A second arg, parent, the parent module,
* is passed in for context, when this method is overridden by
* is passed in for context, when this method is overriden by
* the optimizer. Not shown here to keep code compact.
*/
enable: function (depMap) {
@ -1582,19 +1561,8 @@ var requirejs, require, define;
* internal API, not a public one. Use toUrl for the public API.
*/
nameToUrl: function (moduleName, ext, skipExt) {
var paths, syms, i, parentModule, url,
parentPath, bundleId,
pkgMain = getOwn(config.pkgs, moduleName);
if (pkgMain) {
moduleName = pkgMain;
}
bundleId = getOwn(bundlesMap, moduleName);
if (bundleId) {
return context.nameToUrl(bundleId, ext, skipExt);
}
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
parentPath;
//If a colon is in the URL, it indicates a protocol is used and it is just
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
@ -1608,6 +1576,7 @@ var requirejs, require, define;
} else {
//A module that needs to be converted to a path.
paths = config.paths;
pkgs = config.pkgs;
syms = moduleName.split('/');
//For each module name segment, see if there is a path
@ -1615,7 +1584,7 @@ var requirejs, require, define;
//and work up from it.
for (i = syms.length; i > 0; i -= 1) {
parentModule = syms.slice(0, i).join('/');
pkg = getOwn(pkgs, parentModule);
parentPath = getOwn(paths, parentModule);
if (parentPath) {
//If an array, it means there are a few choices,
@ -1625,6 +1594,16 @@ var requirejs, require, define;
}
syms.splice(0, i, parentPath);
break;
} else if (pkg) {
//If module name is just the package name, then looking
//for the main module.
if (moduleName === pkg.name) {
pkgPath = pkg.location + '/' + pkg.main;
} else {
pkgPath = pkg.location;
}
syms.splice(0, i, pkgPath);
break;
}
}
@ -1939,7 +1918,7 @@ var requirejs, require, define;
}
//Look for a data-main script attribute, which could also adjust the baseUrl.
if (isBrowser && !cfg.skipDataMain) {
if (isBrowser) {
//Figure out baseUrl. Get it from the script tag with require.js in it.
eachReverse(scripts(), function (script) {
//Set the 'head' where we can append children by

View file

@ -16,8 +16,9 @@ body {
color: white;
}
#c9-logo, #ace-logo {
padding: 0;
#logo {
padding: 15px;
margin-left: 70px;
border: none;
}
@ -46,10 +47,4 @@ body {
position: absolute;
right: 0;
border-left: 1px solid;
}
/* .ace_text-input {
z-index: 10!important;
opacity: 1!important;
background: rgb(84, 0, 255)!important;
}*/
}

View file

@ -32,26 +32,25 @@ define(function(require, exports, module) {
"use strict";
var dom = require("ace/lib/dom");
var oop = require("ace/lib/oop");
var event = require("ace/lib/event");
var Range = require("ace/range").Range;
var Tooltip = require("ace/tooltip").Tooltip;
function TokenTooltip (editor) {
var tooltipNode;
var TokenTooltip = function(editor) {
if (editor.tokenTooltip)
return;
Tooltip.call(this, editor.container);
editor.tokenTooltip = this;
editor.tokenTooltip = this;
this.editor = editor;
editor.tooltip = tooltipNode || this.$init();
this.update = this.update.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
this.onMouseOut = this.onMouseOut.bind(this);
event.addListener(editor.renderer.scroller, "mousemove", this.onMouseMove);
event.addListener(editor.renderer.content, "mouseout", this.onMouseOut);
}
oop.inherits(TokenTooltip, Tooltip);
};
(function(){
this.token = {};
@ -64,8 +63,8 @@ oop.inherits(TokenTooltip, Tooltip);
if (this.lastT - (r.timeStamp || 0) > 1000) {
r.rect = null;
r.timeStamp = this.lastT;
this.maxHeight = window.innerHeight;
this.maxWidth = window.innerWidth;
this.maxHeight = innerHeight;
this.maxWidth = innerWidth;
}
var canvasPos = r.rect || (r.rect = r.scroller.getBoundingClientRect());
@ -87,10 +86,15 @@ oop.inherits(TokenTooltip, Tooltip);
}
if (!token) {
session.removeMarker(this.marker);
this.hide();
tooltipNode.style.display = "none";
this.isOpen = false;
return;
}
if (!this.isOpen) {
tooltipNode.style.display = "";
this.isOpen = true;
}
var tokenText = token.type;
if (token.state)
tokenText += "|" + token.state;
@ -98,15 +102,15 @@ oop.inherits(TokenTooltip, Tooltip);
tokenText += "\n merge";
if (token.stateTransitions)
tokenText += "\n " + token.stateTransitions.join("\n ");
if (this.tokenText != tokenText) {
this.setText(tokenText);
this.width = this.getWidth();
this.height = this.getHeight();
tooltipNode.textContent = tokenText;
this.tooltipWidth = tooltipNode.offsetWidth;
this.tooltipHeight = tooltipNode.offsetHeight;
this.tokenText = tokenText;
}
this.show(null, this.x, this.y);
this.updateTooltipPosition(this.x, this.y);
this.token = token;
session.removeMarker(this.marker);
@ -119,34 +123,56 @@ oop.inherits(TokenTooltip, Tooltip);
this.y = e.clientY;
if (this.isOpen) {
this.lastT = e.timeStamp;
this.setPosition(this.x, this.y);
this.updateTooltipPosition(this.x, this.y);
}
if (!this.$timer)
this.$timer = setTimeout(this.update, 100);
};
this.onMouseOut = function(e) {
if (e && e.currentTarget.contains(e.relatedTarget))
return;
this.hide();
var t = e && e.relatedTarget;
var ct = e && e.currentTarget;
while(t && (t = t.parentNode)) {
if (t == ct)
return;
}
tooltipNode.style.display = "none";
this.editor.session.removeMarker(this.marker);
this.$timer = clearTimeout(this.$timer);
this.isOpen = false;
};
this.updateTooltipPosition = function(x, y) {
var st = tooltipNode.style;
if (x + 10 + this.tooltipWidth > this.maxWidth)
x = innerWidth - this.tooltipWidth - 10;
if (y > innerHeight * 0.75 || y + 20 + this.tooltipHeight > this.maxHeight)
y = y - this.tooltipHeight - 30;
st.left = x + 10 + "px";
st.top = y + 20 + "px";
};
this.setPosition = function(x, y) {
if (x + 10 + this.width > this.maxWidth)
x = window.innerWidth - this.width - 10;
if (y > window.innerHeight * 0.75 || y + 20 + this.height > this.maxHeight)
y = y - this.height - 30;
Tooltip.prototype.setPosition.call(this, x + 10, y + 20);
this.$init = function() {
tooltipNode = document.documentElement.appendChild(dom.createElement("div"));
var st = tooltipNode.style;
st.position = "fixed";
st.display = "none";
st.background = "lightyellow";
st.borderRadius = "";
st.border = "1px solid gray";
st.padding = "1px";
st.zIndex = 1000;
st.fontFamily = "monospace";
st.whiteSpace = "pre-line";
return tooltipNode;
};
this.destroy = function() {
this.onMouseOut();
event.removeListener(this.editor.renderer.scroller, "mousemove", this.onMouseMove);
event.removeListener(this.editor.renderer.content, "mouseout", this.onMouseOut);
delete this.editor.tokenTooltip;
delete this.editor.tokenTooltip;
};
}).call(TokenTooltip.prototype);
@ -154,3 +180,4 @@ oop.inherits(TokenTooltip, Tooltip);
exports.TokenTooltip = TokenTooltip;
});

View file

@ -42,7 +42,7 @@ var MultiSelect = require("ace/multi_select").MultiSelect;
exports.createEditor = function(el) {
return new Editor(new Renderer(el));
};
}
exports.createSplitEditor = function(el) {
if (typeof(el) == "string")
@ -62,6 +62,9 @@ exports.createSplitEditor = function(el) {
split.editor1 = split[1] = new Editor(new Renderer(e1));
split.splitter = s;
MultiSelect(split.editor0);
MultiSelect(split.editor1);
s.ratio = 0.5;
split.resize = function resize(){
@ -105,8 +108,8 @@ exports.createSplitEditor = function(el) {
};
var onResizeInterval = function() {
s.ratio = (x - rect.left) / rect.width;
split.resize();
s.ratio = (x - rect.left) / rect.width
split.resize()
};
event.capture(s, onMouseMove, onResizeEnd);
@ -218,7 +221,7 @@ function optgroup(values) {
return values.map(function(item) {
if (typeof item == "string")
item = {name: item, caption: item};
return elt("option", {value: item.value || item.name}, item.caption || item.desc);
return elt("option", {value: item.name}, item.caption || item.desc);
});
}

View file

@ -23,27 +23,24 @@
<pre id="editor"></pre>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src-noconflict/ace.js"></script>
<script src="../build/src-noconflict/ext-modelist.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace", "ace/ext/modelist"], function(ace) {
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
(function () {
var modelist = ace.require("ace/ext/modelist");
var modelist = ace.require('ace/ext/modelist');
// the file path could come from an xmlhttp request, a drop event,
// or any other scriptable file loading process.
// Extensions could consume the modelist and use it to dynamically
// set the editor mode. Webmasters could use it in their scripts
// for site specific purposes as well.
var filePath = "blahblah/weee/some.js";
var filePath = 'blahblah/weee/some.js';
var mode = modelist.getModeForPath(filePath).mode;
console.log(mode);
editor.session.setMode(mode);
}());
})
</script>
<script src="./show_own_source.js"></script>

View file

@ -1,20 +0,0 @@
({
optimize: "none",
preserveLicenseComments: false,
name: "node_modules/almond/almond",
baseUrl: "../../",
paths: {
ace : "lib/ace",
demo: "demo/kitchen-sink"
},
packages: [
],
include: [
"ace/ace"
],
exclude: [
],
out: "./packed.js",
useStrict: true,
wrap: false
})

View file

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Editor</title>
<link rel="stylesheet" href="../kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
</head>
<body>
<div id="optionsPanel" style="position:absolute;height:100%;width:260px">
<a href="http://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
<img id="c9-logo" src="../kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
</a>
</div>
<pre id="editor-container">
<div style="color:black; padding: 10px">
demo showing Ace usage with r.js:
install r.js and almond
and run `<code>r.js -o demo/r.js/build.js</code>`
note that you also need ace/build/src to lazy load modes and themes
require("ace/config").set("basePath", "../../build/src");
require("ace/config").set("packaged", true);
<div>
</pre>
<script src="./packed.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
require("ace/config").set("basePath", "../../build/src")
require("ace/config").set("packaged", true)
var editor = require("ace/ace").edit("editor-container");
editor.session.setMode("ace/mode/javascript");
// editor.session.setValue("var editor = Ace!")
</script>
</body>
</html>

View file

@ -29,20 +29,14 @@
}</pre>
<script src="../demo/kitchen-sink/require.js"></script>
<script src="../build/src/ace.js" charset="utf-8"></script>
<script>
require.config({paths: {ace: "../build/src"}})
define('testace', ['ace/ace'],
function(ace, langtools) {
console.log("This is the testace module");
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.session.setMode("ace/mode/javascript");
require(["ace/requirejs/text!src/ace"], function(e){
editor.setValue(e);
})
}
);
require(['testace'])
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.session.setMode("ace/mode/javascript");
require(["ace/requirejs/text!src/ace"], function(e){
editor.setValue(e);
})
</script>
</body>

View file

@ -5,18 +5,19 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title>
<style type="text/css" media="screen">
.ace_editor {
position: relative !important;
border: 1px solid lightgray;
margin: auto;
height: 200px;
width: 80%;
}
.ace_editor {
position: relative !important;
border: 1px solid lightgray;
margin: auto;
height: 200px;
width: 80%;
}
.ace_editor.fullScreen {
height: auto;
width: auto;
border: 0;
height: auto;
width: auto;
border: 0;
margin: 0;
position: fixed !important;
top: 0;
@ -24,16 +25,17 @@
left: 0;
right: 0;
z-index: 10;
background: white;
}
.fullScreen {
overflow: hidden
}
.fullScreen {
overflow: hidden
}
.scrollmargin {
height: 500px;
.scrollmargin {
height: 500px;
text-align: center;
}
}
.large-button {
color: lightblue;
@ -54,7 +56,7 @@
<body>
<div class="scrollmargin">
<span onclick="scroll()" class="large-button">
scroll down &dArr;
scroll down &dArr;
</span>
</div>
<pre id="editor">function foo(items) {
@ -74,35 +76,28 @@
</div>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src/ace.js"></script>
<script>
require.config({paths: { "ace" : "../lib/ace"}});
require(["ace/ace", "ace/ext/themelist"], function(ace) {
var $ = document.getElementById.bind(document);
var dom = require("ace/lib/dom");
//add command to all new editor instaces
require("ace/commands/default_commands").commands.push({
name: "Toggle Fullscreen",
bindKey: "F11",
exec: function(editor) {
var fullScreen = dom.toggleCssClass(document.body, "fullScreen")
dom.setCssClass(editor.container, "fullScreen", fullScreen)
editor.setAutoScrollEditorIntoView(!fullScreen)
editor.resize()
}
name: "Toggle Fullscreen",
bindKey: "F11",
exec: function(editor) {
dom.toggleCssClass(document.body, "fullScreen")
dom.toggleCssClass(editor.container, "fullScreen")
editor.setAutoScrollEditorIntoView()
editor.resize()
}
})
// create first editor
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.session.setMode("ace/mode/javascript");
editor.renderer.setScrollMargin(10, 10);
editor.setOptions({
// "scrollPastEnd": 0.8,
autoScrollEditorIntoView: true
});
editor.setAutoScrollEditorIntoView();
var count = 1;
function add() {
@ -115,13 +110,12 @@ function add() {
oldEl.parentNode.insertBefore(el, pad.nextSibling)
count++
var theme = themes[Math.floor(themes.length * Math.random() - 1e-5)]
var theme = "ace/theme/" + themes[Math.floor(themes.length * Math.random() - 1e-5)]
editor = ace.edit(el)
editor.setOptions({
mode: "ace/mode/javascript",
theme: theme,
autoScrollEditorIntoView: true
})
editor.setTheme(theme)
editor.session.setMode("ace/mode/javascript")
editor.setAutoScrollEditorIntoView()
editor.setValue([
"this is editor number: ", count, "\n",
@ -132,6 +126,7 @@ function add() {
scroll()
}
function scroll(speed) {
var top = editor.container.getBoundingClientRect().top
speed = speed || 10
@ -144,11 +139,14 @@ function scroll(speed) {
}
}
var themes = require("ace/ext/themelist").themes.map(function(t){return t.theme});
window.add = add;
window.scroll = scroll;
});
var themes = {
bright: [ "chrome", "clouds", "crimson_editor", "dawn", "dreamweaver", "eclipse", "github",
"solarized_light", "textmate", "tomorrow"],
dark: [ "clouds_midnight", "cobalt", "idle_fingers", "kr_theme", "merbivore", "merbivore_soft",
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night",
"tomorrow_night_blue", "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink"]
}
themes = [].concat(themes.bright, themes.dark);
</script>
</body>

View file

@ -23,12 +23,9 @@
<pre id="editor"></pre>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src-noconflict/ace.js"></script>
<script src="../build/src-noconflict/ext-settings_menu.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace", "ace/ext/settings_menu"], function(ace) {
var editor = ace.edit("editor");
ace.require('ace/ext/settings_menu').init(editor);
editor.setTheme("ace/theme/twilight");
@ -41,7 +38,6 @@ require(["ace/ace", "ace/ext/settings_menu"], function(ace) {
},
readOnly: true
}]);
})
</script>
<script src="./show_own_source.js"></script>

View file

@ -1,16 +1,3 @@
if (typeof ace == "undefined" && typeof require == "undefined") {
document.body.innerHTML = "<p style='padding: 20px 50px;'>couldn't find ace.js file, <br>"
+ "to build it run <code>node Makefile.dryice.js full<code>"
} else if (typeof ace == "undefined" && typeof require != "undefined") {
require(["ace/ace"], setValue)
} else {
require = ace.require;
setValue()
}
function setValue() {
require("ace/lib/net").get(document.baseURI, function(t){
var el = document.getElementById("editor");
el.env.editor.setValue(t, 1);
})
}
ace.require("ace/lib/net").get(document.baseURI, function(t){
editor.setValue(t, 1);
})

View file

@ -1,83 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Static Code highlighter using Ace</title>
<meta name="author" content="Matthew Kastor">
<style type="text/css">
.code {
width: 50%;
white-space: pre-wrap;
border: solid lightgrey 1px
}
</style>
</head>
<body>
<h2>Client Side Syntax Highlighting</h2>
<p>Syntax highlighting using Ace language modes and themes.</p>
<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome" ace-gutter="true">
.code {
width: 50%;
white-space: pre-wrap;
border: solid lightgrey 1px
}
</div>
<pre class="code" ace-mode="ace/mode/javascript" ace-theme="ace/theme/twilight">
function wobble (flam) {
return flam.wobbled = true;
}
</pre>
<div class="code" ace-mode="ace/mode/lua" ace-theme="ace/theme/chrome" ace-gutter="true" style="width: 30em;">
--[[--
num_args takes in 5.1 byte code and extracts the number of arguments from its function header.
--]]--
function int(t)
return t:byte(1) + t:byte(2) * 0x100 + t:byte(3) * 0x10000 + t:byte(4) * 0x1000000
end
function num_args(func)
local dump = string.dump(func)
local offset, cursor = int(dump:sub(13)), offset + 26
--Get the params and var flag (whether there's a ... in the param)
return dump:sub(cursor):byte(), dump:sub(cursor+1):byte()
end
</div>
<script src="kitchen-sink/require.js"></script>
<script>
require.config({paths: { "ace" : "../lib/ace"}});
require(["ace/ace", "ace/ext/static_highlight"], function(ace) {
var highlight = ace.require("ace/ext/static_highlight")
var dom = ace.require("ace/lib/dom")
function qsa(sel) {
return Array.apply(null, document.querySelectorAll(sel));
}
qsa(".code").forEach(function (codeEl) {
highlight(codeEl, {
mode: codeEl.getAttribute("ace-mode"),
theme: codeEl.getAttribute("ace-theme"),
startLineNumber: 1,
showGutter: codeEl.getAttribute("ace-gutter"),
trim: true
}, function (highlighted) {
});
});
})
</script>
</body>
</html>

View file

@ -0,0 +1,71 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Static Code highlighter using Ace</title>
<meta name="author" content="Matthew Kastor">
<style type="text/css">
.code {
width: 50%;
position: relative;
white-space: pre-wrap;
}
</style>
</head>
<body>
<h2>Client Side Syntax Highlighting</h2>
<p>Syntax highlighting using Ace language modes and themes.</p>
<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome">
.code {
width: 50%;
position: relative;
white-space: pre-wrap;
}
</div>
<pre class="code" ace-mode="ace/mode/javascript" ace-theme="ace/theme/twilight">
function wobble (flam) {
return flam.wobbled = true;
}
// the scrollbars are from overflow auto on .ace_editor.
</pre>
<script src="../../build/src-noconflict/ace.js"></script>
<script src="../../build/src-noconflict/ext-static_highlight.js"></script>
<script>
var highlighter = ace.require("ace/ext/static_highlight")
var dom = ace.require("ace/lib/dom")
function qsa(sel) {
return [].slice.call(document.querySelectorAll(sel));
}
qsa(".code").forEach(function (codeEl) {
var cs = getComputedStyle(codeEl);
codeEl.style.cssText = codeEl.style.cssText +
'width: ' + cs.width + ';' +
'height: ' + cs.height + ';';
var mode = codeEl.getAttribute('ace-mode');
var theme = codeEl.getAttribute('ace-theme');
var data = codeEl.textContent.trim();
highlighter.render(data, mode, theme, 1, false, function (highlighted) {
dom.importCssString(highlighted.css, "ace_highlight");
dom.importCssString('.ace_editor { overflow: auto; ' +
'position:absolute; top:0; bottom:0; right:0; left:0; }' +
'.ace_gutter { position: relative; }',
'atropa_hial');
codeEl.innerHTML = highlighted.html;
});
});
</script>
</body>
</html>

View file

@ -2,13 +2,15 @@
* Simple node.js server, which generates the synax highlighted version of itself
* using the Ace modes and themes on the server and serving a static web page.
*/
// $'
// include ace search path and modules
require("amd-loader");
// load jsdom, which is required by Ace
require("../../lib/ace/test/mockdom");
var http = require("http");
var fs = require("fs");
var resolve = require("path").resolve;
// load the highlighter and the desired mode and theme
var highlighter = require("../../lib/ace/ext/static_highlight");
@ -18,22 +20,15 @@ var theme = require("../../lib/ace/theme/twilight");
var port = process.env.PORT || 2222;
http.createServer(function(req, res) {
var url = req.url;
var path = /[^#?\x00]*/.exec(url)[0];
var root = resolve(__dirname + "/../../").replace(/\\/g, "/");
path = resolve(root + "/" + path).replace(/\\/g, "/");
if (path.indexOf(root + "/") != 0)
path = __filename;
res.writeHead(200, {"Content-Type": "text/html; charset=utf-8"});
fs.readFile(path, "utf8", function(err, data) {
if (err) data = err.message;
fs.readFile(__filename, "utf8", function(err, data) {
var highlighted = highlighter.render(data, new JavaScriptMode(), theme);
res.end(
'<html><body>\n' +
'<style type="text/css" media="screen">\n' +
highlighted.css +
'</style>\n' +
highlighted.html +
highlighted.html +
'</body></html>'
);
});

View file

@ -41,19 +41,15 @@
<pre id="editor"></pre>
<div id="statusBar">ace rocks!</div>
<script src="kitchen-sink/require.js"></script>
<script src="../build/src-noconflict/ace.js"></script>
<script src="../build/src-noconflict/ext-statusbar.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace", "ace/ext/statusbar"], function(ace) {
var editor = ace.edit("editor");
var StatusBar = ace.require("ace/ext/statusbar").StatusBar;
var StatusBar = ace.require('ace/ext/statusbar').StatusBar;
// create a simple selection status indicator
var statusBar = new StatusBar(editor, document.getElementById("statusBar"));
var statusBar = new StatusBar(editor, document.getElementById('statusBar'));
editor.setTheme("ace/theme/dawn");
editor.session.setMode("ace/mode/html");
});
</script>
<script src="./show_own_source.js"></script>

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,62 +1,49 @@
var editor;
var embedded_editor;
$(function() {
if (typeof ace !== "undefined") {
ace.config.set("workerPath", "build/src-min");
editor = ace.edit("ace_editor_demo");
editor.container.style.opacity = "";
embedded_editor = ace.edit("embedded_ace_code");
embedded_editor.container.style.opacity = "";
embedded_editor.session.setMode("ace/mode/html");
embedded_editor.setAutoScrollEditorIntoView(true);
embedded_editor.setOption("maxLines", 40);
editor.setOptions({
maxLines: 30,
mode: "ace/mode/javascript",
autoScrollEditorIntoView: true
ace.config.set("workerPath", "build/src-min");
editor = ace.edit("ace_editor_demo");
editor.container.style.opacity = "";
embedded_editor = ace.edit("embedded_ace_code");
embedded_editor.container.style.opacity = "";
editor.session.setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
embedded_editor.session.setMode("ace/mode/html");
ace.config.loadModule("ace/ext/emmet", function() {
ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
embedded_editor.setOption("enableEmmet", true);
editor.setOption("enableEmmet", true);
});
ace.config.loadModule("ace/ext/emmet", function() {
ace.require("ace/lib/net").loadScript("http://cloud9ide.github.io/emmet-core/emmet.js", function() {
embedded_editor.setOption("enableEmmet", true);
editor.setOption("enableEmmet", true);
});
embedded_editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
ace.config.loadModule("ace/ext/language_tools", function() {
embedded_editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
});
} else {
document.body.insertAdjacentHTML("afterbegin", '<div class="bs-docs-example">\
<div class="alert alert-error">\
<button type="button" class="close" data-dismiss="alert">\xd7</button>\
<strong>Oh No!</strong> Couldn\'t load <code>build/src/ace.js</code>.<br>\
You can build it by running <code>node Makefile.dryice.js</code><br>\
Or download older version by running <code>git submodule update --init --recursive</code><br>\
</div>\
</div>');
}
$("ul.menu-list").mousedown(function(e) {
if (e.button === 1) {
e.preventDefault();
}
});
ace.config.loadModule("ace/ext/language_tools", function() {
embedded_editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
editor.setOptions({
enableSnippets: true,
enableBasicAutocompletion: true
});
});
embedded_editor.setAutoScrollEditorIntoView(true);
editor.setAutoScrollEditorIntoView(true);
$("ul.menu-list li").click(function(e) {
if (e.target.tagName !== "A") {
var href = $(this).find("a").attr("href");
if (e.button == 1)
window.open(href, "_blank");
else
window.location = href;
if (e.target.tagName === "LI") {
console.log($(this).find("a"));
window.location = $(this).find("a").attr("href");
}
else if (e.target.tagName === "P" || e.target.tagName === "IMG") {
var anchor = $(e.target).siblings();
window.location = anchor.attr("href");
}
});
@ -147,22 +134,22 @@ $(function() {
});
});
$(window).on("hashchange", function(e) {
_gaq.push(['_trackPageview',location.pathname + location.search + location.hash]);
tabs.each(function() {
$(window).on("hashchange", function(e) {
_gaq.push(['_trackPageview',location.pathname + location.search + location.hash]);
tabs.each(function() {
var idx = $.bbq.getState("nav") || "about";
var section = e.fragment.split("&")[1] || "";
$(this).find(tab_a_selector + "[href='#" + idx + "']").triggerHandler('click');
// handles dropping in from new link
var api = $.bbq.getState("api");
if (api) {
$(tab_a_selector + "[href='./api/" + api + ".html']").triggerHandler('click');
}
});
}).trigger("hashchange");
});
}).trigger("hashchange");
highlight();
highlight();
});
@ -171,17 +158,21 @@ function highlight() {
var highlighter = ace.require("ace/ext/static_highlight")
var dom = ace.require("ace/lib/dom")
function qsa(sel) {
var els = document.querySelectorAll(sel);
var result = [];
for (var i = 0, l = els.length; i < l; i++)
result[i] = els[i];
return result;
return [].slice.call(document.querySelectorAll(sel));
}
qsa("code[class]").forEach(function(el) {
var m = el.className.match(/language-(\w+)|(javascript)/);
if (!m) return
var mode = "ace/mode/" + (m[1] || m[2]);
highlighter.highlight(el, {mode: mode, theme: "ace/theme/xcode"})
var theme = "ace/theme/xcode";
var data = dom.getInnerText(el).trim();
highlighter.render(data, mode, theme, 1, true, function (highlighted) {
dom.importCssString(highlighted.css, "ace_highlight");
el.innerHTML = highlighted.html;
});
});
}

View file

@ -497,13 +497,11 @@ img {
.rotating-logo {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
.rotating-logo:hover {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}

@ -1 +1 @@
Subproject commit d93670b47d776987b38bb2c31777c4e488338fac
Subproject commit a3d6d69286903155bc7e1e5cd9c0f541791d384b

View file

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="../demo/kitchen-sink/require.js"></script>
<script type="text/javascript">
require.config({
paths: { ace: "../lib/ace" },
waitSeconds: 0
});
</script>
</head>
<body>
<p><button onclick="toggleEditor()">Toggle editor</button></p>
<div id="container"></div>
<script>
var editor;
var counter = 0
function toggleEditor() {
if (!editor) {
var root = document.createElement("div");
root.style.height = "100px";
root.setAttribute("id", "editor");
root.textContent = "function foo(items) {\nvar x = 'All this is syntax highlighted';\nreturn x;\n}";
document.getElementById("container").appendChild(root);
editor = ace.edit(root);
if (counter++ % 2)
editor.setTheme("ace/theme/monokai");
else
editor.setTheme("ace/theme/clouds");
editor.session.setMode("ace/mode/javascript");
} else {
editor.destroy();
var el = editor.container;
el.parentNode.removeChild(el);
editor.container = null
editor.renderer = null
editor = null;
var root = document.getElementById("editor")
if (root)
root.parentNode.removeChild(root);
}
}
require(["ace/ace"], function(ace) {
window.ace = ace;
toggleEditor();
})
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -11,17 +11,23 @@
commit %commit%
-->
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
<!--DEVEL-->
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
<!--DEVEL-->
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
<!--PACKAGE
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
PACKAGE-->
</head>
<body>
<div id="optionsPanel" style="position:absolute;height:100%;width:260px">
<a href="http://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
<img id="c9-logo" src="demo/kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
<a href="http://ajaxorg.github.com/ace/" >
<img id="logo" src="demo/kitchen-sink/logo.png">
</a>
<div style="position: absolute; overflow: hidden; top:100px; bottom:0">
<div style="position: absolute; overflow: hidden; top:80px; bottom:0">
<div style="width: 120%; height:100%; overflow-y: scroll">
<table id="controls">
@ -57,7 +63,40 @@
<label for="theme">Theme</label>
</td><td>
<select id="theme" size="1">
<optgroup label="Bright">
<option value="ace/theme/chrome">Chrome</option>
<option value="ace/theme/clouds">Clouds</option>
<option value="ace/theme/crimson_editor">Crimson Editor</option>
<option value="ace/theme/dawn">Dawn</option>
<option value="ace/theme/dreamweaver">Dreamweaver</option>
<option value="ace/theme/eclipse">Eclipse</option>
<option value="ace/theme/github">GitHub</option>
<option value="ace/theme/solarized_light">Solarized Light</option>
<option value="ace/theme/textmate" selected="selected">TextMate</option>
<option value="ace/theme/tomorrow">Tomorrow</option>
<option value="ace/theme/xcode">XCode</option>
</optgroup>
<optgroup label="Dark">
<option value="ace/theme/ambiance">Ambiance</option>
<option value="ace/theme/chaos">Chaos</option>
<option value="ace/theme/clouds_midnight">Clouds Midnight</option>
<option value="ace/theme/cobalt">Cobalt</option>
<option value="ace/theme/idle_fingers">idleFingers</option>
<option value="ace/theme/kr_theme">krTheme</option>
<option value="ace/theme/merbivore">Merbivore</option>
<option value="ace/theme/merbivore_soft">Merbivore Soft</option>
<option value="ace/theme/mono_industrial">Mono Industrial</option>
<option value="ace/theme/monokai">Monokai</option>
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
<option value="ace/theme/solarized_dark">Solarized Dark</option>
<option value="ace/theme/terminal">Terminal</option>
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
<option value="ace/theme/twilight">Twilight</option>
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
</optgroup>
</select>
</td>
</tr>
@ -253,13 +292,7 @@
</table>
</td></tr>
</table>
<a href="http://ace.c9.io">
<img id="ace-logo" src="doc/site/images/ace-logo.png" style="width: 134px;margin: 46px 0px 4px 66px;">
</a>
<div><a target="_test" href="./lib/ace/test/tests.html"
style="color: whitesmoke; text-align: left; padding: 1em;">tests</a>
</div>
</div>
</div>
</div>
@ -283,7 +316,7 @@
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
<script src="src/keybinding-vim.js"></script>
<script src="src/keybinding-emacs.js"></script>
<script src="demo/kitchen-sink/demo.js"></script>
<script src="kitchen-sink/demo.js"></script>
<script type="text/javascript" charset="utf-8">
require("kitchen-sink/demo");
</script>

View file

@ -46,15 +46,14 @@ var Editor = require("./editor").Editor;
var EditSession = require("./edit_session").EditSession;
var UndoManager = require("./undomanager").UndoManager;
var Renderer = require("./virtual_renderer").VirtualRenderer;
var MultiSelect = require("./multi_select").MultiSelect;
// The following require()s are for inclusion in the built ace file
require("./worker/worker_client");
require("./keyboard/hash_handler");
require("./placeholder");
require("./multi_select");
require("./mode/folding/fold_mode");
require("./theme/textmate");
require("./ext/error_marker");
exports.config = require("./config");
@ -74,28 +73,19 @@ exports.require = require;
exports.edit = function(el) {
if (typeof(el) == "string") {
var _id = el;
el = document.getElementById(_id);
var el = document.getElementById(_id);
if (!el)
throw new Error("ace.edit can't find div #" + _id);
throw "ace.edit can't find div #" + _id;
}
if (el && el.env && el.env.editor instanceof Editor)
if (el.env && el.env.editor instanceof Editor)
return el.env.editor;
var value = "";
if (el && /input|textarea/i.test(el.tagName)) {
var oldNode = el;
value = oldNode.value;
el = dom.createElement("pre");
oldNode.parentNode.replaceChild(el, oldNode);
} else {
value = dom.getInnerText(el);
el.innerHTML = '';
}
var doc = exports.createEditSession(value);
var doc = exports.createEditSession(dom.getInnerText(el));
el.innerHTML = '';
var editor = new Editor(new Renderer(el));
new MultiSelect(editor);
editor.setSession(doc);
var env = {
@ -103,13 +93,11 @@ exports.edit = function(el) {
editor: editor,
onResize: editor.resize.bind(editor, null)
};
if (oldNode) env.textarea = oldNode;
event.addListener(window, "resize", env.onResize);
editor.on("destroy", function() {
event.removeListener(window, "resize", env.onResize);
env.editor.container.env = null; // prevent memory leak on old ie
});
editor.container.env = editor.env = env;
el.env = editor.env = env;
return editor;
};

View file

@ -36,7 +36,7 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
/**
*
* Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated.
* Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated.
*
* @class Anchor
**/
@ -99,54 +99,69 @@ var Anchor = exports.Anchor = function(doc, row, column) {
* - `value`: An object describing the new Anchor position
*
**/
this.onChange = function(delta) {
if (delta.start.row == delta.end.row && delta.start.row != this.row)
this.onChange = function(e) {
var delta = e.data;
var range = delta.range;
if (range.start.row == range.end.row && range.start.row != this.row)
return;
if (delta.start.row > this.row)
if (range.start.row > this.row)
return;
var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight);
this.setPosition(point.row, point.column, true);
if (range.start.row == this.row && range.start.column > this.column)
return;
var row = this.row;
var column = this.column;
var start = range.start;
var end = range.end;
if (delta.action === "insertText") {
if (start.row === row && start.column <= column) {
if (start.column === column && this.$insertRight) {
// do nothing
} else if (start.row === end.row) {
column += end.column - start.column;
} else {
column -= start.column;
row += end.row - start.row;
}
} else if (start.row !== end.row && start.row < row) {
row += end.row - start.row;
}
} else if (delta.action === "insertLines") {
if (start.row <= row) {
row += end.row - start.row;
}
} else if (delta.action === "removeText") {
if (start.row === row && start.column < column) {
if (end.column >= column)
column = start.column;
else
column = Math.max(0, column - (end.column - start.column));
} else if (start.row !== end.row && start.row < row) {
if (end.row === row)
column = Math.max(0, column - end.column) + start.column;
row -= (end.row - start.row);
} else if (end.row === row) {
row -= end.row - start.row;
column = Math.max(0, column - end.column) + start.column;
}
} else if (delta.action == "removeLines") {
if (start.row <= row) {
if (end.row <= row)
row -= end.row - start.row;
else {
row = start.row;
column = 0;
}
}
}
this.setPosition(row, column, true);
};
function $pointsInOrder(point1, point2, equalPointsInOrder) {
var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
}
function $getTransformedPoint(delta, point, moveIfEqual) {
// Get delta info.
var deltaIsInsert = delta.action == "insert";
var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
var deltaStart = delta.start;
var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
// DELTA AFTER POINT: No change needed.
if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
return {
row: point.row,
column: point.column
};
}
// DELTA BEFORE POINT: Move point by delta shift.
if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
return {
row: point.row + deltaRowShift,
column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
};
}
// DELTA ENVELOPS POINT (delete only): Move point to delta start.
// TODO warn if delta.action != "remove" ?
return {
row: deltaStart.row,
column: deltaStart.column
};
}
/**
* Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped.
@ -176,14 +191,14 @@ var Anchor = exports.Anchor = function(doc, row, column) {
this.row = pos.row;
this.column = pos.column;
this._signal("change", {
this._emit("change", {
old: old,
value: pos
});
};
/**
* When called, the `"change"` event listener is removed.
* When called, the `'change'` event listener is removed.
*
**/
this.detach = function() {

Some files were not shown because too many files have changed in this diff Show more