Merge remote-tracking branch 'remotes/origin/master' into v-1.2
Conflicts: build lib/ace/multi_select_test.js
This commit is contained in:
commit
a4532dd8b9
72 changed files with 2953 additions and 333 deletions
|
|
@ -1,8 +1,15 @@
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ function exportAce(ns, modules, requireBase, extModules) {
|
|||
if (typeof modules == "string")
|
||||
modules = [modules];
|
||||
|
||||
return (text + ";" + template
|
||||
return (text.replace(/;\s*$/, "") + ";" + template
|
||||
.toString()
|
||||
.replace(/MODULES/g, JSON.stringify(modules))
|
||||
.replace(/REQUIRE_NS/g, requireBase)
|
||||
|
|
|
|||
158
api/editor.html
158
api/editor.html
|
|
@ -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/String" class="argument methodClicker" title="String" data-id="String">String</a> text<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/Object" class="argument methodClicker" title="Object" data-id="Object">Object</a> e<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 ">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 ">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>
|
||||
</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'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 "paste" 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 "word" 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 "left" or "right"</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 "left" or "right"</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'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'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. "Behaviors" 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 "vim" or "windows".</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>'changeSelectionStyle'</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>'changeSession'</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—like spaces or new lines—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>
|
||||
|
|
|
|||
42
demo/kitchen-sink/docs/elixir.ex
Normal file
42
demo/kitchen-sink/docs/elixir.ex
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
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
|
||||
|
|
@ -3,6 +3,6 @@
|
|||
<div id="comments">
|
||||
{{#each comments}}
|
||||
<h2><a href="/posts/{{../permalink}}#{{id}}">{{title}}</a></h2>
|
||||
<div>{{body}}</div>
|
||||
<div>{{{body}}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
145
index.html
145
index.html
File diff suppressed because one or more lines are too long
|
|
@ -67,6 +67,7 @@ var Autocomplete = function() {
|
|||
e.stop();
|
||||
}.bind(this));
|
||||
this.popup.focus = this.editor.focus.bind(this.editor);
|
||||
this.popup.on("show", this.tooltipTimer.bind(null, null));
|
||||
this.popup.on("select", this.tooltipTimer.bind(null, null));
|
||||
this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null));
|
||||
return this.popup;
|
||||
|
|
@ -177,7 +178,7 @@ var Autocomplete = function() {
|
|||
return false;
|
||||
|
||||
if (data.completer && data.completer.insertMatch) {
|
||||
data.completer.insertMatch(this.editor);
|
||||
data.completer.insertMatch(this.editor, data);
|
||||
} else {
|
||||
if (this.completions.filterText) {
|
||||
var ranges = this.editor.selection.getAllRanges();
|
||||
|
|
@ -344,7 +345,7 @@ var Autocomplete = function() {
|
|||
doc = selected;
|
||||
|
||||
if (typeof doc == "string")
|
||||
doc = {tooltipText: doc}
|
||||
doc = {docText: doc}
|
||||
if (!doc || !(doc.docHTML || doc.docText))
|
||||
return this.hideDocTooltip();
|
||||
this.showDocTooltip(doc);
|
||||
|
|
@ -352,7 +353,7 @@ var Autocomplete = function() {
|
|||
|
||||
this.showDocTooltip = function(item) {
|
||||
if (!this.tooltipNode) {
|
||||
this.tooltipNode = dom.createElement("pre");
|
||||
this.tooltipNode = dom.createElement("div");
|
||||
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip";
|
||||
this.tooltipNode.style.margin = 0;
|
||||
this.tooltipNode.style.pointerEvents = "auto";
|
||||
|
|
@ -381,7 +382,6 @@ var Autocomplete = function() {
|
|||
tooltipNode.style.left = (rect.right + 1) + "px";
|
||||
tooltipNode.style.right = "";
|
||||
}
|
||||
// tooltipNode.style.height = rect.height + "px";
|
||||
tooltipNode.style.display = "block";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,28 @@ exports.iSearchCommands = [{
|
|||
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); },
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}, {
|
||||
name: 'selectAllMatches',
|
||||
bindKey: 'Ctrl-space',
|
||||
exec: function(iSearch) {
|
||||
var ed = iSearch.$editor,
|
||||
hl = ed.session.$isearchHighlight,
|
||||
ranges = hl && hl.cache ? hl.cache
|
||||
.reduce(function(ranges, ea) {
|
||||
return ranges.concat(ea ? ea : []); }, []) : [];
|
||||
iSearch.deactivate(false);
|
||||
ranges.forEach(ed.selection.addRange.bind(ed.selection));
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}, {
|
||||
name: 'searchAsRegExp',
|
||||
bindKey: 'Alt-r',
|
||||
exec: function(iSearch) {
|
||||
iSearch.convertNeedleToRegExp();
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}];
|
||||
|
||||
function IncrementalSearchKeyboardHandler(iSearch) {
|
||||
|
|
|
|||
|
|
@ -883,7 +883,7 @@ var Editor = function(renderer, session) {
|
|||
/**
|
||||
* Emitted when text is pasted.
|
||||
* @event paste
|
||||
* @param {String} text The pasted text
|
||||
* @param {Object} an object which contains one property, `text`, that represents the text to be pasted. Editing this property will alter the text that is pasted.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -342,29 +342,29 @@ var keymap = {
|
|||
var editorProxy = new AceEmmetEditor();
|
||||
exports.commands = new HashHandler();
|
||||
exports.runEmmetCommand = function(editor) {
|
||||
editorProxy.setupContext(editor);
|
||||
if (editorProxy.getSyntax() == "php")
|
||||
return false;
|
||||
var actions = emmet.require("actions");
|
||||
|
||||
if (this.action == "expand_abbreviation_with_tab") {
|
||||
if (!editor.selection.isEmpty())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.action == "wrap_with_abbreviation") {
|
||||
// without setTimeout prompt doesn't work on firefox
|
||||
return setTimeout(function() {
|
||||
actions.run("wrap_with_abbreviation", editorProxy);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
var pos = editor.selection.lead;
|
||||
var token = editor.session.getTokenAt(pos.row, pos.column);
|
||||
if (token && /\btag\b/.test(token.type))
|
||||
return false;
|
||||
|
||||
try {
|
||||
editorProxy.setupContext(editor);
|
||||
if (editorProxy.getSyntax() == "php")
|
||||
return false;
|
||||
var actions = emmet.require("actions");
|
||||
|
||||
if (this.action == "expand_abbreviation_with_tab") {
|
||||
if (!editor.selection.isEmpty())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.action == "wrap_with_abbreviation") {
|
||||
// without setTimeout prompt doesn't work on firefox
|
||||
return setTimeout(function() {
|
||||
actions.run("wrap_with_abbreviation", editorProxy);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
var pos = editor.selection.lead;
|
||||
var token = editor.session.getTokenAt(pos.row, pos.column);
|
||||
if (token && /\btag\b/.test(token.type))
|
||||
return false;
|
||||
|
||||
var result = actions.run(this.action, editorProxy);
|
||||
} catch(e) {
|
||||
editor._signal("changeStatus", typeof e == "string" ? e : e.message);
|
||||
|
|
@ -393,7 +393,7 @@ exports.updateCommands = function(editor, enabled) {
|
|||
};
|
||||
|
||||
exports.isSupportedMode = function(modeId) {
|
||||
return modeId && /css|less|scss|sass|stylus|html|php|twig/.test(modeId);
|
||||
return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs/.test(modeId);
|
||||
};
|
||||
|
||||
var onChangeMode = function(e, target) {
|
||||
|
|
@ -406,9 +406,8 @@ var onChangeMode = function(e, target) {
|
|||
if (enabled) {
|
||||
if (typeof emmetPath == "string") {
|
||||
require("ace/config").loadModule(emmetPath, function() {
|
||||
|
||||
emmetPath = null;
|
||||
});
|
||||
emmetPath = null;
|
||||
}
|
||||
}
|
||||
exports.updateCommands(editor, enabled);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ var util = require("../autocomplete/util");
|
|||
var textCompleter = require("../autocomplete/text_completer");
|
||||
var keyWordCompleter = {
|
||||
getCompletions: function(editor, session, pos, prefix, callback) {
|
||||
if (session.$mode.completer) {
|
||||
return session.$mode.completer.getCompletions(editor, session, pos, prefix, callback);
|
||||
}
|
||||
var state = editor.session.getState(pos.row);
|
||||
var completions = session.$mode.getCompletions(state, session, pos, prefix);
|
||||
callback(null, completions);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,12 @@ module.exports.generateSettingsMenu = function generateSettingsMenu (editor) {
|
|||
elements.forEach(function(element) {
|
||||
topmenu.appendChild(element);
|
||||
});
|
||||
|
||||
var el = topmenu.appendChild(document.createElement('div'));
|
||||
var version = "1.1.8";
|
||||
el.style.padding = "1em";
|
||||
el.textContent = "Ace version " + version;
|
||||
|
||||
return topmenu;
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ var supportedModes = {
|
|||
DummySyntax: ["dummy"],
|
||||
Eiffel: ["e"],
|
||||
EJS: ["ejs"],
|
||||
Elixir: ["ex|exs"],
|
||||
Elm: ["elm"],
|
||||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr"],
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@ var StatusBar = function(editor, parentNode) {
|
|||
str && status.push(str, separator || "|");
|
||||
}
|
||||
|
||||
if (editor.$vimModeHandler)
|
||||
add(editor.$vimModeHandler.getStatusText());
|
||||
else if (editor.commands.recording)
|
||||
add(editor.keyBinding.getStatusText(editor));
|
||||
if (editor.commands.recording)
|
||||
add("REC");
|
||||
|
||||
var c = editor.selection.lead;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,34 @@ function IncrementalSearch() {
|
|||
|
||||
oop.inherits(IncrementalSearch, Search);
|
||||
|
||||
// regexp handling
|
||||
|
||||
function isRegExp(obj) {
|
||||
return obj instanceof RegExp;
|
||||
}
|
||||
|
||||
function regExpToObject(re) {
|
||||
var string = String(re),
|
||||
start = string.indexOf('/'),
|
||||
flagStart = string.lastIndexOf('/');
|
||||
return {
|
||||
expression: string.slice(start+1, flagStart),
|
||||
flags: string.slice(flagStart+1)
|
||||
}
|
||||
}
|
||||
|
||||
function stringToRegExp(string, flags) {
|
||||
try {
|
||||
return new RegExp(string, flags);
|
||||
} catch (e) { return string; }
|
||||
}
|
||||
|
||||
function objectToRegExp(obj) {
|
||||
return stringToRegExp(obj.expression, obj.flags);
|
||||
}
|
||||
|
||||
// iSearch class
|
||||
|
||||
;(function() {
|
||||
|
||||
this.activate = function(ed, backwards) {
|
||||
|
|
@ -140,10 +168,12 @@ oop.inherits(IncrementalSearch, Search);
|
|||
// try to find the next occurence and enable highlighting marker
|
||||
options.start = this.$currentPos;
|
||||
var session = this.$editor.session,
|
||||
found = this.find(session);
|
||||
found = this.find(session),
|
||||
shouldSelect = this.$editor.emacsMark ?
|
||||
!!this.$editor.emacsMark() : !this.$editor.selection.isEmpty();
|
||||
if (found) {
|
||||
if (options.backwards) found = Range.fromPoints(found.end, found.start);
|
||||
this.$editor.moveCursorToPosition(found.end);
|
||||
this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end));
|
||||
if (moveToNext) this.$currentPos = found.end;
|
||||
// highlight after cursor move, so selection works properly
|
||||
this.highlight(options.re)
|
||||
|
|
@ -156,13 +186,21 @@ oop.inherits(IncrementalSearch, Search);
|
|||
|
||||
this.addString = function(s) {
|
||||
return this.highlightAndFindWithNeedle(false, function(needle) {
|
||||
return needle + s;
|
||||
if (!isRegExp(needle))
|
||||
return needle + s;
|
||||
var reObj = regExpToObject(needle);
|
||||
reObj.expression += s;
|
||||
return objectToRegExp(reObj);
|
||||
});
|
||||
}
|
||||
|
||||
this.removeChar = function(c) {
|
||||
return this.highlightAndFindWithNeedle(false, function(needle) {
|
||||
return needle.length > 0 ? needle.substring(0, needle.length-1) : needle;
|
||||
if (!isRegExp(needle))
|
||||
return needle.substring(0, needle.length-1);
|
||||
var reObj = regExpToObject(needle);
|
||||
reObj.expression = reObj.expression.substring(0, reObj.expression.length-1);
|
||||
return objectToRegExp(reObj);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -189,6 +227,18 @@ oop.inherits(IncrementalSearch, Search);
|
|||
this.addString(text);
|
||||
}
|
||||
|
||||
this.convertNeedleToRegExp = function() {
|
||||
return this.highlightAndFindWithNeedle(false, function(needle) {
|
||||
return isRegExp(needle) ? needle : stringToRegExp(needle, 'ig');
|
||||
});
|
||||
}
|
||||
|
||||
this.convertNeedleToString = function() {
|
||||
return this.highlightAndFindWithNeedle(false, function(needle) {
|
||||
return isRegExp(needle) ? regExpToObject(needle).expression : needle;
|
||||
});
|
||||
}
|
||||
|
||||
this.statusMessage = function(found) {
|
||||
var options = this.$options, msg = '';
|
||||
msg += options.backwards ? 'reverse-' : '';
|
||||
|
|
|
|||
|
|
@ -35,13 +35,17 @@ if (typeof process !== "undefined") {
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var emacs = require('./keyboard/emacs');
|
||||
var EditSession = require("./edit_session").EditSession;
|
||||
var Editor = require("./editor").Editor;
|
||||
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
||||
var Range = require("./range").Range;
|
||||
var MultiSelect = require("./multi_select").MultiSelect;
|
||||
var assert = require("./test/assertions");
|
||||
var IncrementalSearch = require("./incremental_search").IncrementalSearch;
|
||||
|
||||
require("./multi_select");
|
||||
|
||||
var editor, iSearch;
|
||||
function testRanges(str, ranges) {
|
||||
ranges = ranges || editor.selection.getAllRanges();
|
||||
|
|
@ -69,6 +73,7 @@ module.exports = {
|
|||
setUp: function() {
|
||||
var session = new EditSession(["abc123", "xyz124"]);
|
||||
editor = new Editor(new MockRenderer(), session);
|
||||
new MultiSelect(editor);
|
||||
iSearch = new IncrementalSearch();
|
||||
},
|
||||
|
||||
|
|
@ -195,7 +200,7 @@ module.exports = {
|
|||
editor.keyBinding.addKeyboardHandler(emacs.handler);
|
||||
emacs.handler.commands.setMark.exec(editor);
|
||||
iSearch.activate(editor);
|
||||
iSearch.addString('1'); iSearch.addString('2');;
|
||||
iSearch.addString('1'); iSearch.addString('2');
|
||||
testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,24 @@ exports.handler.attach = function(editor) {
|
|||
return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0];
|
||||
};
|
||||
|
||||
editor.emacsMarkForSelection = function(replacement) {
|
||||
// find the mark in $emacsMarkRing corresponding to the current
|
||||
// selection
|
||||
var sel = this.selection,
|
||||
multiRangeLength = this.multiSelect ?
|
||||
this.multiSelect.getAllRanges().length : 1,
|
||||
selIndex = sel.index || 0,
|
||||
markRing = this.session.$emacsMarkRing,
|
||||
markIndex = markRing.length - (multiRangeLength - selIndex),
|
||||
lastMark = markRing[markIndex] || sel.anchor;
|
||||
if (replacement) {
|
||||
markRing.splice(markIndex, 1,
|
||||
"row" in replacement && "column" in replacement ?
|
||||
replacement : undefined);
|
||||
}
|
||||
return lastMark;
|
||||
}
|
||||
|
||||
editor.on("click", $resetMarkMode);
|
||||
editor.on("changeSession", $kbSessionChange);
|
||||
editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates;
|
||||
|
|
@ -146,6 +164,7 @@ exports.handler.detach = function(editor) {
|
|||
editor.commands.removeCommands(commands);
|
||||
editor.removeEventListener('copy', this.onCopy);
|
||||
editor.removeEventListener('paste', this.onPaste);
|
||||
editor.$emacsModeHandler = null;
|
||||
};
|
||||
|
||||
var $kbSessionChange = function(e) {
|
||||
|
|
@ -187,7 +206,7 @@ exports.handler.onCopy = function(e, editor) {
|
|||
if (editor.$handlesEmacsOnCopy) return;
|
||||
editor.$handlesEmacsOnCopy = true;
|
||||
exports.handler.commands.killRingSave.exec(editor);
|
||||
delete editor.$handlesEmacsOnCopy;
|
||||
editor.$handlesEmacsOnCopy = false;
|
||||
};
|
||||
|
||||
exports.handler.onPaste = function(e, editor) {
|
||||
|
|
@ -220,12 +239,22 @@ exports.handler.bindKey = function(key, command) {
|
|||
}, this);
|
||||
};
|
||||
|
||||
exports.handler.getStatusText = function(editor, data) {
|
||||
var str = "";
|
||||
if (data.count)
|
||||
str += data.count;
|
||||
if (data.keyChain)
|
||||
str += " " + data.keyChain
|
||||
return str;
|
||||
};
|
||||
|
||||
exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||
// if keyCode == -1 a non-printable key was pressed, such as just
|
||||
// control. Handling those is currently not supported in this handler
|
||||
if (keyCode === -1) return undefined;
|
||||
|
||||
var editor = data.editor;
|
||||
editor._signal("changeStatus");
|
||||
// insertstring data.count times
|
||||
if (hashId == -1) {
|
||||
editor.pushEmacsMark();
|
||||
|
|
@ -236,24 +265,17 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
}
|
||||
}
|
||||
|
||||
if (key == "\x00") return undefined;
|
||||
|
||||
var modifier = eMods[hashId];
|
||||
|
||||
// CTRL + number / universalArgument for setting data.count
|
||||
if (modifier == "c-" || data.universalArgument) {
|
||||
var prevCount = String(data.count || 0);
|
||||
if (modifier == "c-" || data.count) {
|
||||
var count = parseInt(key[key.length - 1]);
|
||||
if (typeof count === 'number' && !isNaN(count)) {
|
||||
data.count = parseInt(prevCount + count);
|
||||
data.count = Math.max(data.count, 0) || 0;
|
||||
data.count = 10 * data.count + count;
|
||||
return {command: "null"};
|
||||
} else if (data.universalArgument) {
|
||||
// if no number pressed use emacs defaults for universalArgument
|
||||
// which is 4
|
||||
data.count = 4;
|
||||
}
|
||||
}
|
||||
data.universalArgument = false;
|
||||
|
||||
// this.commandKeyBinding maps key specs like "c-p" (for CTRL + P) to
|
||||
// command objects, for lookup key needs to include the modifier
|
||||
|
|
@ -275,7 +297,9 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
if (command === "null") return {command: "null"};
|
||||
|
||||
if (command === "universalArgument") {
|
||||
data.universalArgument = true;
|
||||
// if no number pressed emacs repeats action 4 times.
|
||||
// minus sign is needed to allow next keypress to replace it
|
||||
data.count = -4;
|
||||
return {command: "null"};
|
||||
}
|
||||
|
||||
|
|
@ -318,7 +342,8 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
exec: function(editor, args) {
|
||||
for (var i = 0; i < count; i++)
|
||||
command.exec(editor, args);
|
||||
}
|
||||
},
|
||||
multiSelectAction: command.multiSelectAction
|
||||
}
|
||||
};
|
||||
} else {
|
||||
|
|
@ -439,59 +464,63 @@ exports.handler.addCommands({
|
|||
// selection modification commands. That is,
|
||||
// "goto" commands become "select" commands.
|
||||
// Any insertion or mouse click resets mark-mode.
|
||||
// setMark twice in a row at the same place resets markmode
|
||||
// setMark twice in a row at the same place resets markmode.
|
||||
// in multi select mode, ea selection is handled individually
|
||||
|
||||
if (args && args.count) {
|
||||
var mark = editor.popEmacsMark();
|
||||
mark && editor.selection.moveCursorToPosition(mark);
|
||||
if (editor.inMultiSelectMode) editor.forEachSelection(moveToMark);
|
||||
else moveToMark();
|
||||
moveToMark();
|
||||
return;
|
||||
}
|
||||
|
||||
var mark = editor.emacsMark(),
|
||||
transientMarkModeActive = true;
|
||||
|
||||
ranges = editor.selection.getAllRanges(),
|
||||
rangePositions = ranges.map(function(r) { return {row: r.start.row, column: r.start.column}; }),
|
||||
transientMarkModeActive = true,
|
||||
hasNoSelection = ranges.every(function(range) { return range.isEmpty(); });
|
||||
// if transientMarkModeActive then mark behavior is a little
|
||||
// different. Deactivate the mark when setMark is run with active
|
||||
// mark
|
||||
if (transientMarkModeActive && (mark || !editor.selection.isEmpty())) {
|
||||
editor.pushEmacsMark();
|
||||
editor.clearSelection();
|
||||
if (transientMarkModeActive && (mark || !hasNoSelection)) {
|
||||
if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)})
|
||||
else editor.clearSelection();
|
||||
if (mark) editor.pushEmacsMark(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mark) {
|
||||
var cp = editor.getCursorPosition();
|
||||
if (editor.selection.isEmpty() &&
|
||||
mark.row == cp.row && mark.column == cp.column) {
|
||||
editor.pushEmacsMark();
|
||||
return;
|
||||
}
|
||||
if (!mark) {
|
||||
rangePositions.forEach(function(pos) { editor.pushEmacsMark(pos); });
|
||||
editor.setEmacsMark(rangePositions[rangePositions.length-1]);
|
||||
return;
|
||||
}
|
||||
// turn on mark mode
|
||||
mark = editor.getCursorPosition();
|
||||
editor.setEmacsMark(mark);
|
||||
editor.selection.setSelectionAnchor(mark.row, mark.column);
|
||||
|
||||
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
function moveToMark() {
|
||||
var mark = editor.popEmacsMark();
|
||||
mark && editor.moveCursorToPosition(mark);
|
||||
}
|
||||
|
||||
},
|
||||
readOnly: true,
|
||||
handlesCount: true,
|
||||
multiSelectAction: "forEach"
|
||||
handlesCount: true
|
||||
},
|
||||
exchangePointAndMark: {
|
||||
exec: function(editor, args) {
|
||||
exec: function exchangePointAndMark$exec(editor, args) {
|
||||
var sel = editor.selection;
|
||||
if (args.count) {
|
||||
var pos = editor.getCursorPosition();
|
||||
if (!args.count && !sel.isEmpty()) { // just invert selection
|
||||
sel.setSelectionRange(sel.getRange(), !sel.isBackwards());
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.count) { // replace mark and point
|
||||
var pos = {row: sel.lead.row, column: sel.lead.column};
|
||||
sel.clearSelection();
|
||||
sel.moveCursorToPosition(editor.popEmacsMark());
|
||||
editor.pushEmacsMark(pos);
|
||||
return;
|
||||
sel.moveCursorToPosition(editor.emacsMarkForSelection(pos));
|
||||
} else { // create selection to last mark
|
||||
sel.selectToPosition(editor.emacsMarkForSelection());
|
||||
}
|
||||
var lastMark = editor.getLastEmacsMark();
|
||||
var range = sel.getRange();
|
||||
if (range.isEmpty()) {
|
||||
sel.selectToPosition(lastMark);
|
||||
return;
|
||||
}
|
||||
sel.setSelectionRange(range, !sel.isBackwards());
|
||||
},
|
||||
readOnly: true,
|
||||
handlesCount: true,
|
||||
|
|
@ -544,6 +573,7 @@ exports.handler.addCommands({
|
|||
if (editor.keyBinding.$data.lastCommand != "yank")
|
||||
return;
|
||||
editor.undo();
|
||||
editor.session.$emacsMarkRing.pop(); // also undo recording mark
|
||||
editor.onPaste(exports.killRing.rotate());
|
||||
editor.keyBinding.$data.lastCommand = "yank";
|
||||
},
|
||||
|
|
@ -557,12 +587,25 @@ exports.handler.addCommands({
|
|||
},
|
||||
killRingSave: {
|
||||
exec: function(editor) {
|
||||
// copy text and deselect. will save marks for starts of the
|
||||
// selection(s)
|
||||
|
||||
editor.$handlesEmacsOnCopy = true;
|
||||
var marks = editor.session.$emacsMarkRing.slice(),
|
||||
deselectedMarks = [];
|
||||
exports.killRing.add(editor.getCopyText());
|
||||
|
||||
setTimeout(function() {
|
||||
var sel = editor.selection,
|
||||
range = sel.getRange();
|
||||
editor.pushEmacsMark(sel.isBackwards() ? range.end : range.start);
|
||||
sel.clearSelection();
|
||||
function deselect() {
|
||||
var sel = editor.selection, range = sel.getRange(),
|
||||
pos = sel.isBackwards() ? range.end : range.start;
|
||||
deselectedMarks.push({row: pos.row, column: pos.column});
|
||||
sel.clearSelection();
|
||||
}
|
||||
editor.$handlesEmacsOnCopy = false;
|
||||
if (editor.inMultiSelectMode) editor.forEachSelection({exec: deselect});
|
||||
else deselect();
|
||||
editor.session.$emacsMarkRing = marks.concat(deselectedMarks.reverse());
|
||||
}, 0);
|
||||
},
|
||||
readOnly: true
|
||||
|
|
@ -570,6 +613,7 @@ exports.handler.addCommands({
|
|||
keyboardQuit: function(editor) {
|
||||
editor.selection.clearSelection();
|
||||
editor.setEmacsMark(null);
|
||||
editor.keyBinding.$data.count = null;
|
||||
},
|
||||
focusCommandLine: function(editor, arg) {
|
||||
if (editor.showCommandLine)
|
||||
|
|
|
|||
|
|
@ -35,17 +35,29 @@ if (typeof process !== "undefined") {
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
require("../multi_select");
|
||||
|
||||
var EditSession = require("./../edit_session").EditSession,
|
||||
Editor = require("./../editor").Editor,
|
||||
Range = require("./../range").Range,
|
||||
MockRenderer = require("./../test/mockrenderer").MockRenderer,
|
||||
emacs = require('./emacs'),
|
||||
assert = require("./../test/assertions"),
|
||||
editor;
|
||||
editor, sel;
|
||||
|
||||
function initEditor(docString) {
|
||||
var doc = new EditSession(docString.split("\n"));
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
editor.setKeyboardHandler(emacs.handler);
|
||||
sel = editor.selection;
|
||||
}
|
||||
|
||||
function print(obj) {
|
||||
return JSON.stringify(obj, null, 2);
|
||||
}
|
||||
|
||||
function pluck(arr, what) {
|
||||
return arr.map(function(ea) { return ea[what]; });
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -62,6 +74,72 @@ module.exports = {
|
|||
editor.selectAll();
|
||||
editor.execCommand('keyboardQuit');
|
||||
assert.ok(editor.selection.isEmpty(), 'selection non-empty');
|
||||
},
|
||||
|
||||
"test: exchangePointAndMark without mark set": function() {
|
||||
initEditor('foo');
|
||||
sel.setRange(Range.fromPoints({row: 0, column: 1}, {row: 0, column: 3}));
|
||||
editor.execCommand('exchangePointAndMark');
|
||||
assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition()));
|
||||
},
|
||||
|
||||
"test: exchangePointAndMark with mark set": function() {
|
||||
initEditor('foo');
|
||||
editor.pushEmacsMark({row: 0, column: 1});
|
||||
editor.pushEmacsMark({row: 0, column: 2});
|
||||
editor.execCommand('exchangePointAndMark', {count: 4});
|
||||
assert.deepEqual({row: 0, column: 2}, editor.getCursorPosition(), print(editor.getCursorPosition()));
|
||||
assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 0}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing));
|
||||
},
|
||||
|
||||
"test: exchangePointAndMark with selection": function() {
|
||||
initEditor('foo');
|
||||
editor.pushEmacsMark({row: 0, column: 1});
|
||||
editor.pushEmacsMark({row: 0, column: 2});
|
||||
sel.setRange(Range.fromPoints({row: 0, column: 0}, {row: 0, column: 1}), true);
|
||||
editor.execCommand('exchangePointAndMark');
|
||||
assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition()));
|
||||
assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 2}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing));
|
||||
},
|
||||
|
||||
"test: exchangePointAndMark with multi selection": function() {
|
||||
initEditor('foo\nhello world\n123');
|
||||
var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}],
|
||||
[{row: 1, column: 0}, {row: 1, column: 5}],
|
||||
[{row: 1, column: 6}, {row: 1, column: 11}]]
|
||||
ranges.forEach(function(r) {
|
||||
sel.addRange(Range.fromPoints(r[0], r[1]));
|
||||
});
|
||||
assert.equal("foo\nhello\nworld", editor.getSelectedText());
|
||||
editor.execCommand('exchangePointAndMark');
|
||||
assert.equal("foo\nhello\nworld", editor.getSelectedText());
|
||||
assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), "selections dir not inverted");
|
||||
},
|
||||
|
||||
"test: exchangePointAndMark with multi cursors": function() {
|
||||
initEditor('foo\nhello world\n123');
|
||||
var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}],
|
||||
[{row: 1, column: 0}, {row: 1, column: 5}],
|
||||
[{row: 1, column: 6}, {row: 1, column: 11}]];
|
||||
// move cursors to the start of each range and set a mark to its end
|
||||
// without selecting anything
|
||||
ranges.forEach(function(r) {
|
||||
editor.pushEmacsMark(r[1]);
|
||||
sel.addRange(Range.fromPoints(r[0], r[0]));
|
||||
});
|
||||
assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), print(sel.getAllRanges()));
|
||||
editor.execCommand('exchangePointAndMark');
|
||||
assert.deepEqual(pluck(ranges, 1), pluck(sel.getAllRanges(), 'cursor'), "not inverted: " + print(sel.getAllRanges()));
|
||||
},
|
||||
|
||||
"test: setMark with multi cursors": function() {
|
||||
initEditor('foo\nhello world\n123');
|
||||
var positions = [{row: 0, column: 0},
|
||||
{row: 1, column: 0},
|
||||
{row: 1, column: 6}];
|
||||
positions.forEach(function(p) { sel.addRange(Range.fromPoints(p,p)); });
|
||||
editor.execCommand('setMark');
|
||||
assert.deepEqual(positions, editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing));
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -89,8 +89,16 @@ var KeyBinding = function(editor) {
|
|||
this.getKeyboardHandler = function() {
|
||||
return this.$handlers[this.$handlers.length - 1];
|
||||
};
|
||||
|
||||
this.getStatusText = function() {
|
||||
var data = this.$data;
|
||||
var editor = data.editor;
|
||||
return this.$handlers.map(function(h) {
|
||||
return h.getStatusText && h.getStatusText(editor, data) || "";
|
||||
}).filter(Boolean).join(" ");
|
||||
};
|
||||
|
||||
this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {
|
||||
this.$callKeyboardHandlers = function(hashId, keyString, keyCode, e) {
|
||||
var toExecute;
|
||||
var success = false;
|
||||
var commands = this.$editor.commands;
|
||||
|
|
|
|||
|
|
@ -58,12 +58,13 @@ function checkModes() {
|
|||
}
|
||||
|
||||
function generateTestData() {
|
||||
var docs = jsFileList(cwd + root);
|
||||
var docRoot = root + "/demo/kitchen-sink/docs";
|
||||
var docs = fs.readdirSync(docRoot);
|
||||
var specialDocs = fs.readdirSync(cwd);
|
||||
var modes = modeList();
|
||||
|
||||
console.log("Docs:", docs);
|
||||
console.log("Modes:", modes);
|
||||
// console.log("Docs:", docs);
|
||||
// console.log("Modes:", modes);
|
||||
|
||||
docs.forEach(function(docName) {
|
||||
var p = docName.toLowerCase().split(".");
|
||||
|
|
@ -79,16 +80,19 @@ function generateTestData() {
|
|||
|
||||
var filePath = "text_" + modeName + ".txt";
|
||||
if (specialDocs.indexOf(filePath) == -1) {
|
||||
filePath = root + "/" + docName;
|
||||
filePath = docRoot + "/" + docName;
|
||||
} else {
|
||||
filePath = cwd + filePath;
|
||||
}
|
||||
|
||||
var text = fs.readFileSync(cwd + filePath, "utf8");
|
||||
var text = fs.readFileSync(filePath, "utf8");
|
||||
try {
|
||||
var Mode = require("../" + modeName).Mode;
|
||||
} catch(e) {
|
||||
console.warn("Can't load mode :" + modeName, p, e);
|
||||
return;
|
||||
}
|
||||
console.log(modeName);
|
||||
var tokenizer = new Mode().getTokenizer();
|
||||
|
||||
var state = "start";
|
||||
|
|
|
|||
267
lib/ace/mode/_test/tokens_cirru.json
Normal file
267
lib/ace/mode/_test/tokens_cirru.json
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
[[
|
||||
"start",
|
||||
["comment.line.double-dash","-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","set"],
|
||||
["text"," "],
|
||||
["variable.parameter","a"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","2"],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","self"],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","set"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","child"],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","under"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["support.function","under"],
|
||||
["text"," "],
|
||||
["variable.parameter","parent"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["variable.parameter","a"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","get"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"],
|
||||
["text"," "],
|
||||
["variable.parameter","a"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","set"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"],
|
||||
["text"," "],
|
||||
["variable.parameter","x"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","3"],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","get"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"],
|
||||
["text"," "],
|
||||
["variable.parameter","x"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","set"],
|
||||
["text"," "],
|
||||
["variable.parameter","just-print"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","code"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["variable.parameter","a"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["variable.parameter","just-print"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","eval"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","self"],
|
||||
["storage.modifier",")"],
|
||||
["text"," "],
|
||||
["variable.parameter","just-print"]
|
||||
],[
|
||||
"line",
|
||||
["support.function","eval"],
|
||||
["text"," "],
|
||||
["variable.parameter","just-print"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","string"],
|
||||
["text"," "],
|
||||
["string.quoted.double","\"string with space\""],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","string"],
|
||||
["text"," "],
|
||||
["string.quoted.double","\"escapes "],
|
||||
["constant.character.escape","\\n"],
|
||||
["string.quoted.double"," "],
|
||||
["constant.character.escape","\\\"\\\\"],
|
||||
["string.quoted.double","\""],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["support.function","brackets"],
|
||||
["text"," "],
|
||||
["storage.modifier","((((()))))"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["string.quoted.double","\"eval\""],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","string"],
|
||||
["text"," "],
|
||||
["string.quoted.double","\"eval\""]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","add"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","1"],
|
||||
["storage.modifier",")"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","2"],
|
||||
["storage.modifier","))"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","unwrap"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"]
|
||||
],[
|
||||
"line",
|
||||
["text"," "],
|
||||
["support.function","map"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","a"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","1"],
|
||||
["storage.modifier",")"],
|
||||
["text"," "],
|
||||
["storage.modifier","("],
|
||||
["support.function","b"],
|
||||
["text"," "],
|
||||
["storage.modifier","$"],
|
||||
["text"," "],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","2"],
|
||||
["storage.modifier",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"line",
|
||||
["support.function","print"],
|
||||
["text"," "],
|
||||
["variable.parameter","a"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","1"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["storage.modifier",","],
|
||||
["text"," "],
|
||||
["variable.parameter","b"],
|
||||
["text"," "],
|
||||
["variable.parameter","c"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["support.function","int"],
|
||||
["text"," "],
|
||||
["constant.numeric","2"]
|
||||
],[
|
||||
"line",
|
||||
["markup.raw"," "],
|
||||
["storage.modifier",","],
|
||||
["text"," "],
|
||||
["variable.parameter","d"]
|
||||
]]
|
||||
141
lib/ace/mode/_test/tokens_eiffel.json
Normal file
141
lib/ace/mode/_test/tokens_eiffel.json
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
[[
|
||||
"start",
|
||||
["keyword","note"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["identifier","description"],
|
||||
["keyword.operator",":"],
|
||||
["text"," "],
|
||||
["string.quoted.double","\"Represents a person.\""]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword","class"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["entity.name.type","PERSON"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword","create"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["identifier","make"],
|
||||
["keyword.operator",","],
|
||||
["text"," "],
|
||||
["identifier","make_unknown"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword","feature"],
|
||||
["text"," "],
|
||||
["paren.lparen","{"],
|
||||
["entity.name.type","NONE"],
|
||||
["paren.rparen","}"],
|
||||
["text"," "],
|
||||
["comment.line.double-dash","-- Creation"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["identifier","make"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","a_name"],
|
||||
["keyword.operator",":"],
|
||||
["text"," "],
|
||||
["keyword","like"],
|
||||
["text"," "],
|
||||
["identifier","name"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["comment.line.double-dash","-- Create a person with `a_name' as `name'."]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword","do"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["identifier","name"],
|
||||
["text"," "],
|
||||
["keyword.operator",":="],
|
||||
["text"," "],
|
||||
["identifier","a_name"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword","ensure"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["identifier","name"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["identifier","a_name"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword","end"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["identifier","make_unknown"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword","do"],
|
||||
["text"," "],
|
||||
["keyword","ensure"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["identifier","name"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["constant.language","Void"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword","end"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword","feature"],
|
||||
["text"," "],
|
||||
["comment.line.double-dash","-- Access"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["identifier","name"],
|
||||
["keyword.operator",":"],
|
||||
["text"," "],
|
||||
["keyword","detachable"],
|
||||
["text"," "],
|
||||
["entity.name.type","STRING"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["comment.line.double-dash","-- Full name or Void if unknown."]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword","end"]
|
||||
]]
|
||||
196
lib/ace/mode/_test/tokens_elixir.json
Normal file
196
lib/ace/mode/_test/tokens_elixir.json
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
[[
|
||||
"start",
|
||||
["keyword.control.module.elixir","defmodule"],
|
||||
["meta.module.elixir"," "],
|
||||
["entity.name.type.module.elixir","HelloModule"],
|
||||
["text"," "],
|
||||
["keyword.control.elixir","do"]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["text"," "],
|
||||
["comment.documentation.heredoc","@moduledoc \"\"\""]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," This is supposed to be `markdown`."]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," __Yes__ this is [mark](http://down.format)"]
|
||||
],[
|
||||
"comment.documentation.heredoc"
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," # Truly"]
|
||||
],[
|
||||
"comment.documentation.heredoc"
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," ## marked"]
|
||||
],[
|
||||
"comment.documentation.heredoc"
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," * with lists"]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," * more"]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," * and more"]
|
||||
],[
|
||||
"comment.documentation.heredoc"
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," Even.with(code)"]
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," blocks |> with |> samples"]
|
||||
],[
|
||||
"comment.documentation.heredoc"
|
||||
],[
|
||||
"comment.documentation.heredoc",
|
||||
["comment.documentation.heredoc"," _Docs are first class citizens in Elixir_ (Jose Valim)"]
|
||||
],[
|
||||
"start",
|
||||
["comment.documentation.heredoc"," \"\"\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["punctuation.definition.comment.elixir","#"],
|
||||
["comment.line.number-sign.elixir"," A \"Hello world\" function"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","def"],
|
||||
["text"," some_fun "],
|
||||
["keyword.control.elixir","do"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["variable.other.constant.elixir","IO"],
|
||||
["punctuation.separator.method.elixir","."],
|
||||
["text","puts "],
|
||||
["punctuation.definition.string.begin.elixir","\""],
|
||||
["string.quoted.double.elixir","Juhu Kinners!"],
|
||||
["punctuation.definition.string.end.elixir","\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","end"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["punctuation.definition.comment.elixir","#"],
|
||||
["comment.line.number-sign.elixir"," A private function"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","defp"],
|
||||
["text"," priv "],
|
||||
["keyword.control.elixir","do"]
|
||||
],[
|
||||
"punctuation.definition.string.begin.elixir7",
|
||||
["text"," is_regex "],
|
||||
["punctuation.definition.string.begin.elixir","~r\"\"\""]
|
||||
],[
|
||||
"punctuation.definition.string.begin.elixir7",
|
||||
["string.quoted.double.heredoc.elixir"," This is a regex"]
|
||||
],[
|
||||
"punctuation.definition.string.begin.elixir7",
|
||||
["string.quoted.double.heredoc.elixir"," spanning several"]
|
||||
],[
|
||||
"punctuation.definition.string.begin.elixir7",
|
||||
["string.quoted.double.heredoc.elixir"," lines."]
|
||||
],[
|
||||
"start",
|
||||
["punctuation.definition.string.end.elixir"," \"\"\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," x "],
|
||||
["keyword.operator.assignment.elixir","="],
|
||||
["text"," elem"],
|
||||
["punctuation.section.function.elixir","("],
|
||||
["punctuation.section.scope.elixir","{"],
|
||||
["text"," "],
|
||||
["punctuation.definition.constant.elixir",":"],
|
||||
["constant.other.symbol.elixir","a"],
|
||||
["punctuation.separator.object.elixir",","],
|
||||
["text"," "],
|
||||
["punctuation.definition.constant.elixir",":"],
|
||||
["constant.other.symbol.elixir","b"],
|
||||
["punctuation.separator.object.elixir",","],
|
||||
["text"," "],
|
||||
["punctuation.definition.constant.elixir",":"],
|
||||
["constant.other.symbol.elixir","c"],
|
||||
["text"," "],
|
||||
["punctuation.section.scope.elixir","}"],
|
||||
["punctuation.separator.object.elixir",","],
|
||||
["text"," "],
|
||||
["constant.numeric.elixir","0"],
|
||||
["punctuation.section.function.elixir",")"],
|
||||
["text"," "],
|
||||
["punctuation.definition.comment.elixir","#"],
|
||||
["comment.line.number-sign.elixir","=> :a"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","end"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.elixir","end"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","test_fun "],
|
||||
["keyword.operator.assignment.elixir","="],
|
||||
["text"," "],
|
||||
["keyword.control.elixir","fn"],
|
||||
["punctuation.section.function.elixir","("],
|
||||
["text","x"],
|
||||
["punctuation.section.function.elixir",")"],
|
||||
["text"," "],
|
||||
["keyword.operator.arithmetic.elixir","-"],
|
||||
["keyword.operator.comparison.elixir",">"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","cond"],
|
||||
["text"," "],
|
||||
["keyword.control.elixir","do"]
|
||||
],[
|
||||
"start",
|
||||
["text"," x "],
|
||||
["keyword.operator.comparison.elixir",">"],
|
||||
["text"," "],
|
||||
["constant.numeric.elixir","10"],
|
||||
["text"," "],
|
||||
["keyword.operator.arithmetic.elixir","-"],
|
||||
["keyword.operator.comparison.elixir",">"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["punctuation.definition.constant.elixir",":"],
|
||||
["constant.other.symbol.elixir","greater_than_ten"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["constant.language.elixir","true"],
|
||||
["text"," "],
|
||||
["keyword.operator.arithmetic.elixir","-"],
|
||||
["keyword.operator.comparison.elixir",">"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["punctuation.definition.constant.elixir",":"],
|
||||
["constant.other.symbol.elixir","maybe_ten"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.elixir","end"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.elixir","end"]
|
||||
]]
|
||||
198
lib/ace/mode/_test/tokens_elm.json
Normal file
198
lib/ace/mode/_test/tokens_elm.json
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
[[
|
||||
"start",
|
||||
["comment.start","{-"],
|
||||
["comment"," Ace "],
|
||||
["comment.start","{-"],
|
||||
["comment"," 4 "],
|
||||
["comment.end","-}"],
|
||||
["comment"," Elm "],
|
||||
["comment.end","-}"]
|
||||
],[
|
||||
"start",
|
||||
["constant.language","main"],
|
||||
["text"," "],
|
||||
["keyword","="],
|
||||
["text"," "],
|
||||
["identifier","lift"],
|
||||
["text"," "],
|
||||
["identifier","clock"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","every"],
|
||||
["text"," "],
|
||||
["identifier","second"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["constant.language","clock"],
|
||||
["text"," "],
|
||||
["identifier","t"],
|
||||
["text"," "],
|
||||
["keyword","="],
|
||||
["text"," "],
|
||||
["identifier","collage"],
|
||||
["text"," "],
|
||||
["constant.numeric","400"],
|
||||
["text"," "],
|
||||
["constant.numeric","400"],
|
||||
["text"," "],
|
||||
["paren.lparen","["],
|
||||
["text"," "],
|
||||
["identifier","filled"],
|
||||
["text"," "],
|
||||
["identifier","lightGrey"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","ngon"],
|
||||
["text"," "],
|
||||
["constant.numeric","12"],
|
||||
["text"," "],
|
||||
["constant.numeric","110"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["operator.punctuation",","],
|
||||
["text"," "],
|
||||
["identifier","outlined"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","solid"],
|
||||
["text"," "],
|
||||
["identifier","grey"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","ngon"],
|
||||
["text"," "],
|
||||
["constant.numeric","12"],
|
||||
["text"," "],
|
||||
["constant.numeric","110"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["operator.punctuation",","],
|
||||
["text"," "],
|
||||
["identifier","hand"],
|
||||
["text"," "],
|
||||
["identifier","orange"],
|
||||
["text"," "],
|
||||
["constant.numeric","100"],
|
||||
["text"," "],
|
||||
["identifier","t"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["operator.punctuation",","],
|
||||
["text"," "],
|
||||
["identifier","hand"],
|
||||
["text"," "],
|
||||
["identifier","charcoal"],
|
||||
["text"," "],
|
||||
["constant.numeric","100"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","t"],
|
||||
["keyword.operator","/"],
|
||||
["constant.numeric","60"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["operator.punctuation",","],
|
||||
["text"," "],
|
||||
["identifier","hand"],
|
||||
["text"," "],
|
||||
["identifier","charcoal"],
|
||||
["text"," "],
|
||||
["constant.numeric","60"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","t"],
|
||||
["keyword.operator","/"],
|
||||
["constant.numeric","720"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["paren.rparen","]"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["constant.language","hand"],
|
||||
["text"," "],
|
||||
["identifier","clr"],
|
||||
["text"," "],
|
||||
["identifier","len"],
|
||||
["text"," "],
|
||||
["identifier","time"],
|
||||
["text"," "],
|
||||
["keyword","="]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["identifier","angle"],
|
||||
["text"," "],
|
||||
["keyword","="],
|
||||
["text"," "],
|
||||
["identifier","degrees"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["constant.numeric","90"],
|
||||
["text"," "],
|
||||
["keyword.operator","-"],
|
||||
["text"," "],
|
||||
["constant.numeric","6"],
|
||||
["text"," "],
|
||||
["keyword.operator","*"],
|
||||
["text"," "],
|
||||
["identifier","inSeconds"],
|
||||
["text"," "],
|
||||
["identifier","time"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","in"],
|
||||
["text"," "],
|
||||
["identifier","traced"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","solid"],
|
||||
["text"," "],
|
||||
["identifier","clr"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["keyword.operator","<|"],
|
||||
["text"," "],
|
||||
["identifier","segment"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["constant.numeric","0"],
|
||||
["operator.punctuation",","],
|
||||
["constant.numeric","0"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","len"],
|
||||
["text"," "],
|
||||
["keyword.operator","*"],
|
||||
["text"," "],
|
||||
["identifier","cos"],
|
||||
["text"," "],
|
||||
["identifier","angle"],
|
||||
["operator.punctuation",","],
|
||||
["text"," "],
|
||||
["identifier","len"],
|
||||
["text"," "],
|
||||
["keyword.operator","*"],
|
||||
["text"," "],
|
||||
["identifier","sin"],
|
||||
["text"," "],
|
||||
["identifier","angle"],
|
||||
["paren.rparen",")"]
|
||||
]]
|
||||
296
lib/ace/mode/_test/tokens_gcode.json
Normal file
296
lib/ace/mode/_test/tokens_gcode.json
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
[[
|
||||
"start",
|
||||
["identifier","O"],
|
||||
["constant.numeric","003"],
|
||||
["text"," "],
|
||||
["comment","(DIAMOND SQUARE)"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N2"],
|
||||
["text"," "],
|
||||
["string","G54"],
|
||||
["text"," "],
|
||||
["string","G90"],
|
||||
["text"," "],
|
||||
["string","G49"],
|
||||
["text"," "],
|
||||
["string","G80"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N3"],
|
||||
["text"," "],
|
||||
["string","M6"],
|
||||
["text"," "],
|
||||
["identifier","T"],
|
||||
["constant.numeric","1"],
|
||||
["text"," "],
|
||||
["comment","(1.ENDMILL)"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N4"],
|
||||
["text"," "],
|
||||
["string","M3"],
|
||||
["text"," "],
|
||||
["identifier","S"],
|
||||
["constant.numeric","1800"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N5"],
|
||||
["text"," "],
|
||||
["string","G0"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","-.6"],
|
||||
["text"," "],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","2.050"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N6"],
|
||||
["text"," "],
|
||||
["string","G43"],
|
||||
["text"," "],
|
||||
["identifier","H"],
|
||||
["constant.numeric","1"],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric",".1"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N7"],
|
||||
["text"," "],
|
||||
["string","G1"],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric","-.3"],
|
||||
["text"," "],
|
||||
["identifier","F"],
|
||||
["constant.numeric","50."]
|
||||
],[
|
||||
"start",
|
||||
["comment","N8"],
|
||||
["text"," "],
|
||||
["string","G41"],
|
||||
["text"," "],
|
||||
["identifier","D"],
|
||||
["constant.numeric","1"],
|
||||
["text"," "],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","1.45"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N9"],
|
||||
["text"," "],
|
||||
["string","G1"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","0"],
|
||||
["text"," "],
|
||||
["identifier","F"],
|
||||
["constant.numeric","20."]
|
||||
],[
|
||||
"start",
|
||||
["comment","N10"],
|
||||
["text"," "],
|
||||
["string","G2"],
|
||||
["text"," "],
|
||||
["identifier","J"],
|
||||
["constant.numeric","-1.45"]
|
||||
],[
|
||||
"start",
|
||||
["comment","(CUTTER COMP CANCEL)"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N11"],
|
||||
["text"," "],
|
||||
["string","G1"],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric","-.2"],
|
||||
["text"," "],
|
||||
["identifier","F"],
|
||||
["constant.numeric","50."]
|
||||
],[
|
||||
"start",
|
||||
["comment","N12"],
|
||||
["text"," "],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","-.990"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N13"],
|
||||
["text"," "],
|
||||
["string","G40"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N14"],
|
||||
["text"," "],
|
||||
["string","G0"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","-.6"],
|
||||
["text"," "],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","1.590"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N15"],
|
||||
["text"," "],
|
||||
["string","G0"],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric",".1"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N16"],
|
||||
["text"," "],
|
||||
["string","M5"],
|
||||
["text"," "],
|
||||
["string","G49"],
|
||||
["text"," "],
|
||||
["string","G28"],
|
||||
["text"," "],
|
||||
["string","G91"],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric","0"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N17"],
|
||||
["text"," "],
|
||||
["identifier","CALL"],
|
||||
["text"," "],
|
||||
["identifier","O"],
|
||||
["constant.numeric","9456"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N18"],
|
||||
["text"," #"],
|
||||
["constant.numeric","500"],
|
||||
["text","="],
|
||||
["constant.numeric","0.004"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N19"],
|
||||
["text"," #"],
|
||||
["constant.numeric","503"],
|
||||
["text","="],
|
||||
["paren.lparen","["],
|
||||
["text","#"],
|
||||
["constant.numeric","500"],
|
||||
["text","+#"],
|
||||
["constant.numeric","501"],
|
||||
["paren.rparen","]"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N20"],
|
||||
["text"," "],
|
||||
["identifier","VC"],
|
||||
["constant.numeric","45"],
|
||||
["text","="],
|
||||
["constant.numeric","0.0006"]
|
||||
],[
|
||||
"start",
|
||||
["identifier","VS"],
|
||||
["constant.numeric","4"],
|
||||
["text","="],
|
||||
["constant.numeric","0.0007"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N21"],
|
||||
["text"," "],
|
||||
["string","G90"],
|
||||
["text"," "],
|
||||
["string","G10"],
|
||||
["text"," "],
|
||||
["identifier","L"],
|
||||
["constant.numeric","20"],
|
||||
["text"," "],
|
||||
["identifier","P"],
|
||||
["constant.numeric","3"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","5."],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","4."],
|
||||
["text"," "],
|
||||
["identifier","Z"],
|
||||
["constant.numeric","6.567"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N22"],
|
||||
["text"," "],
|
||||
["string","G0"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","5000"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N23"],
|
||||
["text"," "],
|
||||
["identifier","IF"],
|
||||
["text"," "],
|
||||
["paren.lparen","["],
|
||||
["text","#"],
|
||||
["constant.numeric","1"],
|
||||
["text"," "],
|
||||
["identifier","LT"],
|
||||
["text"," "],
|
||||
["constant.numeric","0.370"],
|
||||
["paren.rparen","]"],
|
||||
["text"," "],
|
||||
["identifier","GOTO"],
|
||||
["text"," "],
|
||||
["constant.numeric","49"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N24"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","-0.678"],
|
||||
["text"," "],
|
||||
["identifier","Y"],
|
||||
["constant.numeric","+.990"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N25"],
|
||||
["text"," "],
|
||||
["string","G84.3"],
|
||||
["text"," "],
|
||||
["identifier","X"],
|
||||
["constant.numeric","-0.1"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N26"],
|
||||
["text"," #"],
|
||||
["constant.numeric","4"],
|
||||
["text","=#"],
|
||||
["constant.numeric","5"],
|
||||
["text","*"],
|
||||
["identifier","COS"],
|
||||
["paren.lparen","["],
|
||||
["constant.numeric","45"],
|
||||
["paren.rparen","]"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N27"],
|
||||
["text"," #"],
|
||||
["constant.numeric","4"],
|
||||
["text","=#"],
|
||||
["constant.numeric","5"],
|
||||
["text","*"],
|
||||
["identifier","SIN"],
|
||||
["paren.lparen","["],
|
||||
["constant.numeric","45"],
|
||||
["paren.rparen","]"]
|
||||
],[
|
||||
"start",
|
||||
["comment","N28"],
|
||||
["text"," "],
|
||||
["identifier","VZOFZ"],
|
||||
["text","="],
|
||||
["constant.numeric","652.9658"]
|
||||
],[
|
||||
"start",
|
||||
["text","%"]
|
||||
]]
|
||||
|
|
@ -59,9 +59,9 @@
|
|||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"],
|
||||
["storage.type.start","{{"],
|
||||
["support.function","{{{"],
|
||||
["variable.parameter","body"],
|
||||
["storage.type.end","}}"],
|
||||
["support.function","}}}"],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
|
|
|
|||
|
|
@ -144,7 +144,9 @@
|
|||
["text"," "],
|
||||
["support.function","link_to"],
|
||||
["text"," "],
|
||||
["string","'Show'"],
|
||||
["string.start","'"],
|
||||
["string","Show"],
|
||||
["string.end","'"],
|
||||
["text",", "],
|
||||
["identifier","book"],
|
||||
["text"," "],
|
||||
|
|
@ -162,7 +164,9 @@
|
|||
["text"," "],
|
||||
["support.function","link_to"],
|
||||
["text"," "],
|
||||
["string","'Edit'"],
|
||||
["string.start","'"],
|
||||
["string","Edit"],
|
||||
["string.end","'"],
|
||||
["text",", "],
|
||||
["identifier","edit_book_path"],
|
||||
["paren.lparen","("],
|
||||
|
|
@ -183,7 +187,9 @@
|
|||
["text"," "],
|
||||
["support.function","link_to"],
|
||||
["text"," "],
|
||||
["string","'Remove'"],
|
||||
["string.start","'"],
|
||||
["string","Remove"],
|
||||
["string.end","'"],
|
||||
["text",", "],
|
||||
["identifier","book"],
|
||||
["text",", "],
|
||||
|
|
@ -191,7 +197,9 @@
|
|||
["text"," "],
|
||||
["punctuation.separator.key-value","=>"],
|
||||
["text"," "],
|
||||
["string","'Are you sure?'"],
|
||||
["string.start","'"],
|
||||
["string","Are you sure?"],
|
||||
["string.end","'"],
|
||||
["text",", "],
|
||||
["constant.other.symbol.ruby",":method"],
|
||||
["text"," "],
|
||||
|
|
@ -239,7 +247,9 @@
|
|||
["text"," "],
|
||||
["support.function","link_to"],
|
||||
["text"," "],
|
||||
["string","'New book'"],
|
||||
["string.start","'"],
|
||||
["string","New book"],
|
||||
["string.end","'"],
|
||||
["text",", "],
|
||||
["identifier","new_book_path"],
|
||||
["text"," "],
|
||||
|
|
|
|||
49
lib/ace/mode/_test/tokens_io.json
Normal file
49
lib/ace/mode/_test/tokens_io.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
[[
|
||||
"start",
|
||||
["punctuation.definition.comment.io","//"],
|
||||
["comment.line.double-slash.io"," computes factorial of a number"]
|
||||
],[
|
||||
"start",
|
||||
["text","factorial "],
|
||||
["keyword.operator.io",":="],
|
||||
["text"," "],
|
||||
["support.function.io","method"],
|
||||
["text","(n,"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control.io","if"],
|
||||
["text","(n "],
|
||||
["keyword.operator.io","=="],
|
||||
["text"," "],
|
||||
["constant.numeric.io","0"],
|
||||
["text",", "],
|
||||
["keyword.control.io","return"],
|
||||
["text"," "],
|
||||
["constant.numeric.io","1"],
|
||||
["text",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," res "],
|
||||
["keyword.operator.io",":="],
|
||||
["text"," "],
|
||||
["constant.numeric.io","1"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["support.class.io","Range"],
|
||||
["text"," "],
|
||||
["constant.numeric.io","1"],
|
||||
["text"," "],
|
||||
["support.function.io","to"],
|
||||
["text","(n) "],
|
||||
["keyword.control.io","foreach"],
|
||||
["text","(i, res "],
|
||||
["keyword.operator.io","="],
|
||||
["text"," res "],
|
||||
["keyword.operator.io","*"],
|
||||
["text"," i)"]
|
||||
],[
|
||||
"start",
|
||||
["text",")"]
|
||||
]]
|
||||
4
lib/ace/mode/_test/tokens_jsoniq.json
Normal file
4
lib/ace/mode/_test/tokens_jsoniq.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[[
|
||||
"[\"start\"]",
|
||||
["support.function","TODO"]
|
||||
]]
|
||||
|
|
@ -1,4 +1,90 @@
|
|||
[[
|
||||
["blockComment","noQstring"],
|
||||
["comment.start","%{"]
|
||||
],[
|
||||
["blockComment","blockComment","blockComment","noQstring"],
|
||||
["comment.start"," %{"]
|
||||
],[
|
||||
["blockComment","blockComment","blockComment","noQstring"],
|
||||
["comment"," Ace Matlab demo"]
|
||||
],[
|
||||
["blockComment","noQstring"],
|
||||
["comment.end"," %}"]
|
||||
],[
|
||||
"noQstring",
|
||||
["comment.end","%}"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["identifier","TODO"]
|
||||
["keyword","classdef"],
|
||||
["text"," "],
|
||||
["identifier","hello"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["support.function","methods"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","function"],
|
||||
["text"," "],
|
||||
["identifier","greet"],
|
||||
["paren.lparen","("],
|
||||
["identifier","this"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["support.function","disp"],
|
||||
["paren.lparen","("],
|
||||
["string","'Hello!'"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["comment","% say hi"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","end"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","end"]
|
||||
],[
|
||||
"start",
|
||||
["keyword","end"]
|
||||
],[
|
||||
"noQstring"
|
||||
],[
|
||||
"start",
|
||||
["comment","% transpose "]
|
||||
],[
|
||||
"qqstring",
|
||||
["identifier","a"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["paren.lparen","["],
|
||||
["text"," "],
|
||||
["string","'x"],
|
||||
["constant.language.escape","''"],
|
||||
["string","y'"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["string","\"x"],
|
||||
["constant.language.escape","\\n"],
|
||||
["string","\\"]
|
||||
],[
|
||||
"start",
|
||||
["string"," y\""],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["constant.numeric","1"],
|
||||
["text","' "],
|
||||
["paren.rparen","]"],
|
||||
["text","' "],
|
||||
["keyword.operator","+"],
|
||||
["text"," "],
|
||||
["constant.numeric","2"],
|
||||
["text","'"]
|
||||
]]
|
||||
|
|
@ -145,7 +145,9 @@
|
|||
["text"," "],
|
||||
["punctuation.separator.key-value","=>"],
|
||||
["text"," "],
|
||||
["string","\"value\""],
|
||||
["string.start","\""],
|
||||
["string","value"],
|
||||
["string.end","\""],
|
||||
["paren.rparen","}"]
|
||||
],[
|
||||
"start"
|
||||
|
|
|
|||
|
|
@ -331,4 +331,4 @@
|
|||
["keyword","fi"]
|
||||
],[
|
||||
"start"
|
||||
]]
|
||||
]]
|
||||
|
|
@ -157,13 +157,12 @@
|
|||
["text.xml"," "],
|
||||
["punctuation.definition.tag.begin.soy","{"],
|
||||
["entity.name.tag.soy","param"],
|
||||
["text"," "],
|
||||
["meta.tag.param.soy"," "],
|
||||
["entity.other.attribute-name.soy","name"],
|
||||
["keyword.operator.soy",":"],
|
||||
["meta.tag.param.soy"," "],
|
||||
["variable.other.soy","$additionalName"],
|
||||
["text"," "],
|
||||
["meta.tag.param.soy","/"],
|
||||
["meta.tag.param.soy"," /"],
|
||||
["punctuation.definition.tag.end.soy","}"]
|
||||
],[
|
||||
"start",
|
||||
|
|
|
|||
44
lib/ace/mode/_test/tokens_xquery.json
Normal file
44
lib/ace/mode/_test/tokens_xquery.json
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
[[
|
||||
"[\"start\"]",
|
||||
["keyword","xquery"],
|
||||
["text"," "],
|
||||
["keyword","version"],
|
||||
["text"," "],
|
||||
["string","\""],
|
||||
["string","1.0"],
|
||||
["string","\""],
|
||||
["text",";"]
|
||||
],[
|
||||
"[\"start\"]"
|
||||
],[
|
||||
"[\"start\"]",
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["variable","$message"],
|
||||
["text"," "],
|
||||
["keyword.operator",":="],
|
||||
["text"," "],
|
||||
["string","\""],
|
||||
["string","Hello World!"],
|
||||
["string","\""]
|
||||
],[
|
||||
"[\"start\",\"StartTag\",\"TagContent\"]",
|
||||
["keyword","return"],
|
||||
["text"," "],
|
||||
["meta.tag","<results"],
|
||||
["meta.tag",">"]
|
||||
],[
|
||||
"[\"start\",\"StartTag\",\"TagContent\"]",
|
||||
["text"," "],
|
||||
["meta.tag","<message"],
|
||||
["meta.tag",">"],
|
||||
["text","{"],
|
||||
["variable","$message"],
|
||||
["text","}"],
|
||||
["meta.tag","</message>"]
|
||||
],[
|
||||
"[\"start\"]",
|
||||
["meta.tag","</results>"]
|
||||
],[
|
||||
"[\"start\"]"
|
||||
]]
|
||||
133
lib/ace/mode/behaviour/behaviour_test.js
Normal file
133
lib/ace/mode/behaviour/behaviour_test.js
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/* ***** 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 ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
require("../../multi_select");
|
||||
var assert = require("../../test/assertions");
|
||||
var Range = require("../../range").Range;
|
||||
var Editor = require("../../editor").Editor;
|
||||
var EditSession = require("../../edit_session").EditSession;
|
||||
var MockRenderer = require("../../test/mockrenderer").MockRenderer;
|
||||
var JavaScriptMode = require("../javascript").Mode;
|
||||
var editor;
|
||||
var exec = function(name, times, args) {
|
||||
do {
|
||||
editor.commands.exec(name, editor, args);
|
||||
} while(times --> 1);
|
||||
};
|
||||
var testRanges = function(str) {
|
||||
assert.equal(editor.selection.getAllRanges() + "", str + "");
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "ACE multi_select.js",
|
||||
|
||||
"test: cstyle": function() {
|
||||
function testValue(line) {
|
||||
assert.equal(editor.getValue(), Array(4).join(line + "\n"));
|
||||
}
|
||||
function testSelection(line, col, inc) {
|
||||
editor.selection.rangeList.ranges.forEach(function(r) {
|
||||
assert.range(r, line, col, line, col);
|
||||
line += (inc || 1);
|
||||
});
|
||||
}
|
||||
var doc = new EditSession([
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
], new JavaScriptMode());
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
editor.setOption("behavioursEnabled", true);
|
||||
|
||||
editor.navigateFileStart();
|
||||
exec("addCursorBelow", 2);
|
||||
|
||||
exec("insertstring", 1, "if ");
|
||||
|
||||
// pairing (
|
||||
exec("insertstring", 1, "(");
|
||||
testValue("if ()");
|
||||
testSelection(0, 4);
|
||||
exec("insertstring", 1, ")");
|
||||
testValue("if ()");
|
||||
testSelection(0, 5);
|
||||
|
||||
// pairing [
|
||||
exec("gotoleft", 1);
|
||||
exec("insertstring", 1, "[");
|
||||
testValue("if ([])");
|
||||
testSelection(0, 5);
|
||||
|
||||
exec("insertstring", 1, "]");
|
||||
testValue("if ([])");
|
||||
testSelection(0, 6);
|
||||
|
||||
// test deletion
|
||||
exec("gotoleft", 1);
|
||||
exec("backspace", 1);
|
||||
testValue("if ()");
|
||||
testSelection(0, 4);
|
||||
|
||||
exec("gotolineend", 1);
|
||||
exec("insertstring", 1, "{");
|
||||
testValue("if (){}");
|
||||
testSelection(0, 6);
|
||||
|
||||
exec("insertstring", 1, "}");
|
||||
testValue("if (){}");
|
||||
testSelection(0, 7);
|
||||
|
||||
exec("gotolinestart", 1);
|
||||
exec("insertstring", 1, "(");
|
||||
testValue("(if (){}");
|
||||
exec("backspace", 1);
|
||||
|
||||
editor.setValue("");
|
||||
exec("insertstring", 1, "{");
|
||||
assert.equal(editor.getValue(), "{")
|
||||
exec("insertstring", 1, "\n");
|
||||
assert.equal(editor.getValue(), "{\n \n}")
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
|
|
@ -42,11 +42,11 @@ var SAFE_INSERT_BEFORE_TOKENS =
|
|||
["text", "paren.rparen", "punctuation.operator", "comment"];
|
||||
|
||||
var context;
|
||||
var contextCache = {}
|
||||
var contextCache = {};
|
||||
var initContext = function(editor) {
|
||||
var id = -1;
|
||||
if (editor.multiSelect) {
|
||||
id = editor.selection.id;
|
||||
id = editor.selection.index;
|
||||
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
|
||||
contextCache = {rangeCount: editor.multiSelect.rangeCount};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -34,6 +34,7 @@ define(function(require, exports, module) {
|
|||
var oop = require("../../lib/oop");
|
||||
var Behaviour = require("../behaviour").Behaviour;
|
||||
var TokenIterator = require("../../token_iterator").TokenIterator;
|
||||
var lang = require("../../lib/lang");
|
||||
|
||||
function is(token, type) {
|
||||
return token.type.lastIndexOf(type + ".xml") > -1;
|
||||
|
|
@ -140,29 +141,59 @@ var XmlBehaviour = function () {
|
|||
return;
|
||||
|
||||
return {
|
||||
text: '>' + '</' + element + '>',
|
||||
text: ">" + "</" + element + ">",
|
||||
selection: [1, 1]
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
|
||||
this.add("autoindent", "insertion", function (state, action, editor, session, text) {
|
||||
if (text == "\n") {
|
||||
var cursor = editor.getCursorPosition();
|
||||
var line = session.getLine(cursor.row);
|
||||
var rightChars = line.substring(cursor.column, cursor.column + 2);
|
||||
if (rightChars == '</') {
|
||||
var next_indent = this.$getIndent(line);
|
||||
var indent = next_indent + session.getTabString();
|
||||
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
||||
var token = iterator.getCurrentToken();
|
||||
|
||||
return {
|
||||
text: '\n' + indent + '\n' + next_indent,
|
||||
selection: [1, indent.length, 1, indent.length]
|
||||
};
|
||||
if (token && token.type.indexOf("tag-close") !== -1) {
|
||||
//get tag name
|
||||
while (token && token.type.indexOf("tag-name") === -1) {
|
||||
token = iterator.stepBackward();
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tag = token.value;
|
||||
var row = iterator.getCurrentTokenRow();
|
||||
|
||||
//don't indent after closing tag
|
||||
token = iterator.stepBackward();
|
||||
if (!token || token.type.indexOf("end-tag") !== -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.voidElements && !this.voidElements[tag]) {
|
||||
var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
|
||||
var line = session.getLine(row);
|
||||
var nextIndent = this.$getIndent(line);
|
||||
var indent = nextIndent + session.getTabString();
|
||||
|
||||
if (nextToken && nextToken.value === "</") {
|
||||
return {
|
||||
text: "\n" + indent + "\n" + nextIndent,
|
||||
selection: [1, indent.length, 1, indent.length]
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
text: "\n" + indent
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
oop.inherits(XmlBehaviour, Behaviour);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ var DockerfileHighlightRules = function() {
|
|||
if (startRules[i].token == "variable.language") {
|
||||
startRules.splice(i, 0, {
|
||||
token: "constant.language",
|
||||
regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)\\b)",
|
||||
regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|COPY)\\b)",
|
||||
caseInsensitive: true
|
||||
});
|
||||
break;
|
||||
|
|
|
|||
58
lib/ace/mode/elixir.js
Normal file
58
lib/ace/mode/elixir.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 ***** */
|
||||
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
|
||||
// TODO: pick appropriate fold mode
|
||||
var FoldMode = require("./folding/coffee").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
this.HighlightRules = ElixirHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "#";
|
||||
// this.blockComment = {start: ""/*"", end: ""*/""};
|
||||
// Extra logic goes here.
|
||||
this.$id = "ace/mode/elixir"
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
433
lib/ace/mode/elixir_highlight_rules.js
Normal file
433
lib/ace/mode/elixir_highlight_rules.js
Normal file
|
|
@ -0,0 +1,433 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 ***** */
|
||||
|
||||
/* This file was autogenerated from https://raw.githubusercontent.com/elixir-lang/elixir-tmbundle/master/Syntaxes/Elixir.tmLanguage (uuid: ) */
|
||||
/****************************************************************************************
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var ElixirHighlightRules = function() {
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = { start:
|
||||
[ { token:
|
||||
[ 'meta.module.elixir',
|
||||
'keyword.control.module.elixir',
|
||||
'meta.module.elixir',
|
||||
'entity.name.type.module.elixir' ],
|
||||
regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module|type)?doc (?:~[a-z])?"""',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*"""',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module|type)?doc ~[A-Z]"""',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*"""',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*\'\'\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*\'\'\'',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.false',
|
||||
regex: '@(?:module|type)?doc false',
|
||||
comment: '@doc false is treated as documentation' },
|
||||
{ token: 'comment.documentation.string',
|
||||
regex: '@(?:module|type)?doc "',
|
||||
push:
|
||||
[ { token: 'comment.documentation.string',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'comment.documentation.string' } ],
|
||||
comment: '@doc with string is treated as documentation' },
|
||||
{ token: 'keyword.control.elixir',
|
||||
regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
|
||||
{ token: 'keyword.operator.elixir',
|
||||
regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
|
||||
comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
|
||||
{ token: 'constant.language.elixir',
|
||||
regex: '\\b(?:nil|true|false)\\b(?![?!])' },
|
||||
{ token: 'variable.language.elixir',
|
||||
regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.variable.elixir',
|
||||
'variable.other.readwrite.module.elixir' ],
|
||||
regex: '(@)([a-zA-Z_]\\w*)' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.variable.elixir',
|
||||
'variable.other.anonymous.elixir' ],
|
||||
regex: '(&)(\\d*)' },
|
||||
{ token: 'variable.other.constant.elixir',
|
||||
regex: '\\b[A-Z]\\w*\\b' },
|
||||
{ token: 'constant.numeric.elixir',
|
||||
regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: ':\'',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.constant.elixir',
|
||||
regex: '\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: ':"',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.constant.elixir',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '(?:\'\'\')',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>\'\'\')',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*\'\'\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ],
|
||||
comment: 'Single-quoted heredocs' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '\'',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'support.function.variable.quoted.single.elixir' } ],
|
||||
comment: 'single quoted string (allows for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '(?:""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ],
|
||||
comment: 'Double-quoted heredocs' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '"',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.elixir' } ],
|
||||
comment: 'double quoted string (allows for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z](?:""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '~[a-z](?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ],
|
||||
comment: 'Double-quoted heredocs sigils' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z]\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\}[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z]\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z]\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\>[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z]\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\)[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[a-z][^\\w]',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '[^\\w][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z](?:""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '~[A-Z](?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'Double-quoted heredocs sigils' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z]\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\}[a-z]*',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z]\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\][a-z]*',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z]\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\>[a-z]*',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z]\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\)[a-z]*',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '~[A-Z][^\\w]',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '[^\\w][a-z]*',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
|
||||
regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
|
||||
comment: 'symbols' },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
|
||||
comment: 'symbols' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.comment.elixir',
|
||||
'comment.line.number-sign.elixir' ],
|
||||
regex: '(#)(.*)' },
|
||||
{ token: 'constant.numeric.elixir',
|
||||
regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
|
||||
comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
|
||||
/* { token: 'punctuation.separator.variable.elixir',
|
||||
regex: '(?<=\\{|do|\\{\\s|do\\s)\\|',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<=\\{|do|\\{\\s|do\\s)(\\|)',
|
||||
push:
|
||||
[ { token: 'punctuation.separator.variable.elixir',
|
||||
regex: '\\|',
|
||||
next: 'pop' },
|
||||
{ token: 'variable.other.block.elixir',
|
||||
regex: '[_a-zA-Z][_a-zA-Z0-9]*' },
|
||||
{ token: 'punctuation.separator.variable.elixir', regex: ',' } ] },*/
|
||||
{ token: 'keyword.operator.assignment.augmented.elixir',
|
||||
regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
|
||||
{ token: 'keyword.operator.comparison.elixir',
|
||||
regex: '===?|!==?|<=?|>=?' },
|
||||
{ token: 'keyword.operator.bitwise.elixir',
|
||||
regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
|
||||
{ token: 'keyword.operator.logical.elixir',
|
||||
regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
|
||||
originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
|
||||
{ token: 'keyword.operator.arithmetic.elixir',
|
||||
regex: '\\*|\\+|\\-|/' },
|
||||
{ token: 'keyword.operator.other.elixir',
|
||||
regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
|
||||
{ token: 'keyword.operator.assignment.elixir', regex: '=' },
|
||||
{ token: 'punctuation.separator.other.elixir', regex: ':' },
|
||||
{ token: 'punctuation.separator.statement.elixir',
|
||||
regex: '\\;' },
|
||||
{ token: 'punctuation.separator.object.elixir', regex: ',' },
|
||||
{ token: 'punctuation.separator.method.elixir', regex: '\\.' },
|
||||
{ token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
|
||||
{ token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
|
||||
{ token: 'punctuation.section.function.elixir',
|
||||
regex: '\\(|\\)' } ],
|
||||
'#escaped_char':
|
||||
[ { token: 'constant.character.escape.elixir',
|
||||
regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ],
|
||||
'#interpolated_elixir':
|
||||
[ { token:
|
||||
[ 'source.elixir.embedded.source',
|
||||
'source.elixir.embedded.source.empty' ],
|
||||
regex: '(#\\{)(\\})' },
|
||||
{ todo:
|
||||
{ token: 'punctuation.section.embedded.elixir',
|
||||
regex: '#\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.embedded.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly_and_self' },
|
||||
{ include: '$self' },
|
||||
{ defaultToken: 'source.elixir.embedded.source' } ] } } ],
|
||||
'#nest_curly_and_self':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly_and_self' } ] },
|
||||
{ include: '$self' } ],
|
||||
'#regex_sub':
|
||||
[ { include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.arbitrary-repitition.elixir',
|
||||
'string.regexp.arbitrary-repitition.elixir',
|
||||
'string.regexp.arbitrary-repitition.elixir',
|
||||
'punctuation.definition.arbitrary-repitition.elixir' ],
|
||||
regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
|
||||
{ token: 'punctuation.definition.character-class.elixir',
|
||||
regex: '\\[(?:\\^?\\])?',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.character-class.elixir',
|
||||
regex: '\\]',
|
||||
next: 'pop' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.regexp.character-class.elixir' } ] },
|
||||
{ token: 'punctuation.definition.group.elixir',
|
||||
regex: '\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.group.elixir',
|
||||
regex: '\\)',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ defaultToken: 'string.regexp.group.elixir' } ] },
|
||||
{ token:
|
||||
[ 'punctuation.definition.comment.elixir',
|
||||
'comment.line.number-sign.elixir' ],
|
||||
regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
|
||||
originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
|
||||
comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] }
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
|
||||
fileTypes: [ 'ex', 'exs' ],
|
||||
firstLineMatch: '^#!/.*\\belixir',
|
||||
foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
|
||||
foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
|
||||
keyEquivalent: '^~E',
|
||||
name: 'Elixir',
|
||||
scopeName: 'source.elixir' }
|
||||
|
||||
|
||||
oop.inherits(ElixirHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.ElixirHighlightRules = ElixirHighlightRules;
|
||||
});
|
||||
|
|
@ -21,7 +21,7 @@ var Mode = function() {
|
|||
oop.inherits(Mode, HtmlMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.blockComment = {start: "{!--", end: "--}"};
|
||||
this.$id = "ace/mode/handlebars";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ var HandlebarsHighlightRules = function() {
|
|||
var hbs = {
|
||||
regex : "(?={{)",
|
||||
push : "handlebars"
|
||||
}
|
||||
};
|
||||
for (var key in this.$rules) {
|
||||
this.$rules[key].unshift(hbs);
|
||||
}
|
||||
|
|
@ -40,22 +40,22 @@ var HandlebarsHighlightRules = function() {
|
|||
defaultToken : "comment"
|
||||
}]
|
||||
}, {
|
||||
token : "storage.type.start", // begin section
|
||||
regex : "{{[#\\^/&]?",
|
||||
token : "support.function", // unescaped variable
|
||||
regex : "{{{",
|
||||
push : [{
|
||||
token : "storage.type.end",
|
||||
regex : "}}",
|
||||
token : "support.function",
|
||||
regex : "}}}",
|
||||
next : pop2
|
||||
}, {
|
||||
token : "variable.parameter",
|
||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*"
|
||||
}]
|
||||
}, {
|
||||
token : "support.function", // unescaped variable
|
||||
regex : "{{{",
|
||||
token : "storage.type.start", // begin section
|
||||
regex : "{{[#\\^/&]?",
|
||||
push : [{
|
||||
token : "support.function",
|
||||
regex : "}}}",
|
||||
token : "storage.type.end",
|
||||
regex : "}}",
|
||||
next : pop2
|
||||
}, {
|
||||
token : "variable.parameter",
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ oop.inherits(JsonWorker, Mirror);
|
|||
var value = this.doc.getValue();
|
||||
|
||||
try {
|
||||
var result = parse(value);
|
||||
if (value)
|
||||
parse(value);
|
||||
} catch (e) {
|
||||
var pos = this.doc.indexToPosition(e.at-1);
|
||||
this.sender.emit("error", {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ var Range = require("../range").Range;
|
|||
var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var Anchor = require("../anchor").Anchor;
|
||||
var LanguageTools = require("../ext/language_tools");
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new JSONiqLexer();
|
||||
|
|
@ -52,14 +51,16 @@ oop.inherits(Mode, TextMode);
|
|||
|
||||
(function() {
|
||||
|
||||
LanguageTools.addCompleter({
|
||||
this.completer = {
|
||||
getCompletions: function(editor, session, pos, prefix, callback) {
|
||||
if (!session.$worker)
|
||||
return callback();
|
||||
session.$worker.emit("complete", { data: { pos: pos, prefix: prefix } });
|
||||
session.$worker.on("complete", function(e){
|
||||
callback(null, e.data);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -41,37 +41,20 @@ var WorkerClient = require("../worker/worker_client").WorkerClient;
|
|||
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var unicode = require("../unicode");
|
||||
var HtmlMode = require("./html").Mode;
|
||||
var JavaScriptMode = require("./javascript").Mode;
|
||||
var CssMode = require("./css").Mode;
|
||||
|
||||
var Mode = function(opts) {
|
||||
this.inlinePhp = opts && opts.inline;
|
||||
var HighlightRules = this.inlinePhp ? PhpLangHighlightRules : PhpHighlightRules;
|
||||
this.HighlightRules = HighlightRules;
|
||||
var PhpMode = function(opts) {
|
||||
this.HighlightRules = PhpLangHighlightRules;
|
||||
this.$outdent = new MatchingBraceOutdent();
|
||||
this.$behaviour = new CstyleBehaviour();
|
||||
this.foldingRules = new CStyleFoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
oop.inherits(PhpMode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.tokenRe = new RegExp("^["
|
||||
+ unicode.packages.L
|
||||
+ unicode.packages.Mn + unicode.packages.Mc
|
||||
+ unicode.packages.Nd
|
||||
+ unicode.packages.Pc + "\_]+", "g"
|
||||
);
|
||||
|
||||
this.nonTokenRe = new RegExp("^(?:[^"
|
||||
+ unicode.packages.L
|
||||
+ unicode.packages.Mn + unicode.packages.Mc
|
||||
+ unicode.packages.Nd
|
||||
+ unicode.packages.Pc + "\_]|\s])+", "g"
|
||||
);
|
||||
|
||||
|
||||
this.lineCommentStart = ["//", "#"];
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
|
|
@ -79,18 +62,17 @@ oop.inherits(Mode, TextMode);
|
|||
var tokens = tokenizedLine.tokens;
|
||||
var endState = tokenizedLine.state;
|
||||
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "php-start") {
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[\:]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
} else if (state == "php-doc-start") {
|
||||
if (endState != "php-doc-start") {
|
||||
} else if (state == "doc-start") {
|
||||
if (endState != "doc-start") {
|
||||
return "";
|
||||
}
|
||||
var match = line.match(/^\s*(\/?)\*/);
|
||||
|
|
@ -113,10 +95,48 @@ oop.inherits(Mode, TextMode);
|
|||
this.$outdent.autoOutdent(doc, row);
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/php-inline";
|
||||
}).call(PhpMode.prototype);
|
||||
|
||||
var Mode = function(opts) {
|
||||
if (opts && opts.inline) {
|
||||
PhpMode.call(this);
|
||||
return;
|
||||
}
|
||||
HtmlMode.call(this);
|
||||
this.HighlightRules = PhpHighlightRules;
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode,
|
||||
"php-": PhpMode
|
||||
});
|
||||
};
|
||||
oop.inherits(Mode, HtmlMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.tokenRe = new RegExp("^["
|
||||
+ unicode.packages.L
|
||||
+ unicode.packages.Mn + unicode.packages.Mc
|
||||
+ unicode.packages.Nd
|
||||
+ unicode.packages.Pc + "\_]+", "g"
|
||||
);
|
||||
|
||||
this.nonTokenRe = new RegExp("^(?:[^"
|
||||
+ unicode.packages.L
|
||||
+ unicode.packages.Mn + unicode.packages.Mc
|
||||
+ unicode.packages.Nd
|
||||
+ unicode.packages.Pc + "\_]|\s])+", "g"
|
||||
);
|
||||
|
||||
|
||||
this.lineCommentStart = ["//", "#"];
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
|
||||
if (this.inlinePhp)
|
||||
worker.call("setOptions", [{inline: true}]);
|
||||
|
||||
|
|
|
|||
65
lib/ace/mode/php_test.js
Normal file
65
lib/ace/mode/php_test.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/* ***** 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 ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var EditSession = require("../edit_session").EditSession;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var Mode = require("./php").Mode;
|
||||
var assert = require("../test/assertions");
|
||||
|
||||
module.exports = {
|
||||
"test: inline mode" : function() {
|
||||
var mode = new Mode();
|
||||
var tokenizer = mode.getTokenizer();
|
||||
var tokens = tokenizer.getLineTokens("'juhu kinners' ?> html <? 'php'", "start").tokens;
|
||||
assert.equal("string", tokens[tokens.length - 1].type);
|
||||
assert.notEqual("string", tokens[0].type);
|
||||
assert.equal(tokens.length, 4);
|
||||
|
||||
mode = new Mode({inline: true});
|
||||
tokenizer = mode.getTokenizer();
|
||||
tokens = tokenizer.getLineTokens("'juhu kinners' ?> html <? 'php'", "start").tokens;
|
||||
assert.equal("string", tokens[0].type);
|
||||
assert.equal("string", tokens[tokens.length - 1].type);
|
||||
assert.equal(tokens.length, 9);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
|
|
@ -141,9 +141,71 @@ var RubyHighlightRules = function() {
|
|||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||
},
|
||||
|
||||
qString,
|
||||
qqString,
|
||||
tString,
|
||||
[{
|
||||
regex: "[{}]", onMatch: function(val, state, stack) {
|
||||
this.next = val == "{" ? this.nextState : "";
|
||||
if (val == "{" && stack.length) {
|
||||
stack.unshift("start", state);
|
||||
return "paren.lparen";
|
||||
}
|
||||
if (val == "}" && stack.length) {
|
||||
stack.shift();
|
||||
this.next = stack.shift();
|
||||
if (this.next.indexOf("string") != -1)
|
||||
return "paren.end";
|
||||
}
|
||||
return val == "{" ? "paren.lparen" : "paren.rparen";
|
||||
},
|
||||
nextState: "start"
|
||||
}, {
|
||||
token : "string.start",
|
||||
regex : /"/,
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
||||
}, {
|
||||
token : "paren.start",
|
||||
regex : /\#{/,
|
||||
push : "start"
|
||||
}, {
|
||||
token : "string.end",
|
||||
regex : /"/,
|
||||
next : "pop"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}, {
|
||||
token : "string.start",
|
||||
regex : /`/,
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\(?:[nsrtvfbae'"\\]|c.|C-.|M-.(?:\\C-.)?|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4})/
|
||||
}, {
|
||||
token : "paren.start",
|
||||
regex : /\#{/,
|
||||
push : "start"
|
||||
}, {
|
||||
token : "string.end",
|
||||
regex : /`/,
|
||||
next : "pop"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}, {
|
||||
token : "string.start",
|
||||
regex : /'/,
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\['\\]/
|
||||
}, {
|
||||
token : "string.end",
|
||||
regex : /'/,
|
||||
next : "pop"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}],
|
||||
// TODO: add support for %[QqxWwrs][{[(]
|
||||
|
||||
{
|
||||
token : "text", // namespaces aren't symbols
|
||||
|
|
|
|||
|
|
@ -127,10 +127,14 @@ var RustHighlightRules = function() {
|
|||
regex: '$',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.line.double-dash.source.rust' } ] },
|
||||
{ token: 'comment.block.source.rust',
|
||||
{ token: 'comment.start.block.source.rust',
|
||||
regex: '/\\*',
|
||||
stateName: 'comment',
|
||||
push:
|
||||
[ { token: 'comment.block.source.rust',
|
||||
[ { token: 'comment.start.block.source.rust',
|
||||
regex: '/\\*',
|
||||
push: 'comment' },
|
||||
{ token: 'comment.end.block.source.rust',
|
||||
regex: '\\*/',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.block.source.rust' } ] } ],
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ var SoyTemplateHighlightRules = function() {
|
|||
[ 'entity.other.attribute-name.soy',
|
||||
'text',
|
||||
'keyword.operator.soy' ],
|
||||
regex: '\\b([\\w]*)(\\s*)((?::)?)' },
|
||||
regex: '\\b([\\w]+)(\\s*)((?::)?)' },
|
||||
{ defaultToken: 'meta.tag.param.soy' } ] } ],
|
||||
'#primitive':
|
||||
[ { token: 'constant.language.soy',
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ var Range = require("../range").Range;
|
|||
var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour;
|
||||
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||
var Anchor = require("../anchor").Anchor;
|
||||
var LanguageTools = require("../ext/language_tools");
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new XQueryLexer();
|
||||
|
|
@ -51,14 +50,16 @@ oop.inherits(Mode, TextMode);
|
|||
|
||||
(function() {
|
||||
|
||||
LanguageTools.addCompleter({
|
||||
this.completer = {
|
||||
getCompletions: function(editor, session, pos, prefix, callback) {
|
||||
if (!session.$worker)
|
||||
return callback();
|
||||
session.$worker.emit("complete", { data: { pos: pos, prefix: prefix } });
|
||||
session.$worker.on("complete", function(e){
|
||||
callback(null, e.data);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
|
|
|||
|
|
@ -36,23 +36,23 @@ if (typeof process !== "undefined") {
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var EditSession = require("./edit_session").EditSession;
|
||||
var Editor = require("./editor").Editor;
|
||||
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
||||
var Range = require("./range").Range;
|
||||
require("./multi_select");
|
||||
var assert = require("./test/assertions");
|
||||
var MultiSelect = require("./multi_select").MultiSelect;
|
||||
var Range = require("./range").Range;
|
||||
var Editor = require("./editor").Editor;
|
||||
var EditSession = require("./edit_session").EditSession;
|
||||
var MockRenderer = require("./test/mockrenderer").MockRenderer;
|
||||
var UndoManager = require("./undomanager").UndoManager;
|
||||
|
||||
var editor;
|
||||
var exec = function(name, times, args) {
|
||||
do {
|
||||
editor.commands.exec(name, editor, args);
|
||||
} while(times --> 1)
|
||||
} while(times --> 1);
|
||||
};
|
||||
var testRanges = function(str) {
|
||||
assert.equal(editor.selection.getAllRanges() + "", str + "");
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
|
@ -65,7 +65,6 @@ module.exports = {
|
|||
" wtt.w"
|
||||
]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
|
||||
editor.navigateFileEnd();
|
||||
exec("selectMoreBefore", 3);
|
||||
|
|
@ -92,7 +91,6 @@ module.exports = {
|
|||
" wtt.we"
|
||||
]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
|
||||
editor.selectMoreLines(1);
|
||||
testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]");
|
||||
|
|
@ -115,9 +113,8 @@ module.exports = {
|
|||
" wtt.w"
|
||||
]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
|
||||
editor.selectMoreLines(1)
|
||||
editor.selectMoreLines(1);
|
||||
testRanges("Range: [0/0] -> [0/0],Range: [1/0] -> [1/0]");
|
||||
assert.ok(editor.inMultiSelectMode);
|
||||
|
||||
|
|
@ -136,7 +133,6 @@ module.exports = {
|
|||
" wtt.w"
|
||||
]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
var selection = editor.selection;
|
||||
|
||||
var range1 = new Range(0, 2, 0, 4);
|
||||
|
|
@ -160,7 +156,6 @@ module.exports = {
|
|||
"test: onPaste in command with multiselect": function() {
|
||||
var doc = new EditSession(["l1", "l2"]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
editor.commands.addCommand({
|
||||
name: 'insertfoo',
|
||||
exec: function(ed) { ed.onPaste('foo'); },
|
||||
|
|
@ -169,7 +164,7 @@ module.exports = {
|
|||
var selection = editor.selection;
|
||||
var range1 = new Range(0,2,0,2);
|
||||
var range2 = new Range(1,2,1,2);
|
||||
selection.fromOrientedRange(range1)
|
||||
selection.fromOrientedRange(range1);
|
||||
selection.addRange(range2);
|
||||
editor.execCommand('insertfoo');
|
||||
assert.equal('l1foo\nl2foo', editor.getValue());
|
||||
|
|
@ -178,14 +173,13 @@ module.exports = {
|
|||
"test multiselect fromJSON/toJSON": function() {
|
||||
var doc = new EditSession(["l1", "l2"]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
var selection = editor.selection;
|
||||
|
||||
var before = selection.toJSON();
|
||||
|
||||
var range1 = new Range(0,2,0,2);
|
||||
var range2 = new Range(1,2,1,2);
|
||||
selection.fromOrientedRange(range1)
|
||||
selection.fromOrientedRange(range1);
|
||||
selection.addRange(range2);
|
||||
|
||||
var after = selection.toJSON();
|
||||
|
|
@ -217,5 +211,5 @@ module.exports = {
|
|||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
|
|
|
|||
7
lib/ace/snippets/dockerfile.js
Normal file
7
lib/ace/snippets/dockerfile.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./dockerfile.snippets");
|
||||
exports.scope = "dockerfile";
|
||||
|
||||
});
|
||||
0
lib/ace/snippets/dockerfile.snippets
Normal file
0
lib/ace/snippets/dockerfile.snippets
Normal file
7
lib/ace/snippets/dummy.js
Normal file
7
lib/ace/snippets/dummy.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./.snippets");
|
||||
exports.scope = "";
|
||||
|
||||
});
|
||||
7
lib/ace/snippets/dummy_syntax.js
Normal file
7
lib/ace/snippets/dummy_syntax.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./.snippets");
|
||||
exports.scope = "";
|
||||
|
||||
});
|
||||
7
lib/ace/snippets/eiffel.js
Normal file
7
lib/ace/snippets/eiffel.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./eiffel.snippets");
|
||||
exports.scope = "eiffel";
|
||||
|
||||
});
|
||||
0
lib/ace/snippets/eiffel.snippets
Normal file
0
lib/ace/snippets/eiffel.snippets
Normal file
7
lib/ace/snippets/elixir.js
Normal file
7
lib/ace/snippets/elixir.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./.snippets");
|
||||
exports.scope = "";
|
||||
|
||||
});
|
||||
0
lib/ace/snippets/elixir.snippets
Normal file
0
lib/ace/snippets/elixir.snippets
Normal file
7
lib/ace/snippets/elm.js
Normal file
7
lib/ace/snippets/elm.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./elm.snippets");
|
||||
exports.scope = "elm";
|
||||
|
||||
});
|
||||
0
lib/ace/snippets/elm.snippets
Normal file
0
lib/ace/snippets/elm.snippets
Normal file
0
lib/ace/snippets/io.snippets
Normal file
0
lib/ace/snippets/io.snippets
Normal file
0
lib/ace/snippets/vala.snippets
Normal file
0
lib/ace/snippets/vala.snippets
Normal file
|
|
@ -43,6 +43,7 @@ var testNames = [
|
|||
"ace/mode/folding/pythonic_test",
|
||||
"ace/mode/folding/xml_test",
|
||||
"ace/mode/folding/coffee_test",
|
||||
"ace/mode/behaviour/behaviour_test",
|
||||
"ace/multi_select_test",
|
||||
"ace/mouse/mouse_handler_test",
|
||||
"ace/occur_test",
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ define(function(require, exports, module) {
|
|||
"use strict";
|
||||
|
||||
// tokenizing lines longer than this makes editor very slow
|
||||
var MAX_TOKEN_COUNT = 1000;
|
||||
var MAX_TOKEN_COUNT = 2000;
|
||||
/**
|
||||
* This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter).
|
||||
* @class Tokenizer
|
||||
|
|
@ -77,9 +77,11 @@ var Tokenizer = function(rules) {
|
|||
if (rule.token.length == 1 || matchcount == 1) {
|
||||
rule.token = rule.token[0];
|
||||
} else if (matchcount - 1 != rule.token.length) {
|
||||
throw new Error("number of classes and regexp groups in '" +
|
||||
rule.token + "'\n'" + rule.regex + "' doesn't match\n"
|
||||
+ (matchcount - 1) + "!=" + rule.token.length);
|
||||
this.reportError("number of classes and regexp groups doesn't match", {
|
||||
rule: rule,
|
||||
groupCount: matchcount - 1
|
||||
});
|
||||
rule.token = rule.token[0];
|
||||
} else {
|
||||
rule.tokenArray = rule.token;
|
||||
rule.token = null;
|
||||
|
|
@ -240,6 +242,7 @@ var Tokenizer = function(rules) {
|
|||
|
||||
var match, tokens = [];
|
||||
var lastIndex = 0;
|
||||
var matchAttempts = 0;
|
||||
|
||||
var token = {type: null, value: ""};
|
||||
|
||||
|
|
@ -280,7 +283,7 @@ var Tokenizer = function(rules) {
|
|||
|
||||
state = this.states[currentState];
|
||||
if (!state) {
|
||||
window.console && console.error && console.error(currentState, "doesn't exist");
|
||||
this.reportError("state doesn't exist", currentState);
|
||||
currentState = "start";
|
||||
state = this.states[currentState];
|
||||
}
|
||||
|
|
@ -293,7 +296,7 @@ var Tokenizer = function(rules) {
|
|||
}
|
||||
|
||||
if (value) {
|
||||
if (typeof type == "string") {
|
||||
if (typeof type === "string") {
|
||||
if ((!rule || rule.merge !== false) && token.type === type) {
|
||||
token.value += value;
|
||||
} else {
|
||||
|
|
@ -315,7 +318,13 @@ var Tokenizer = function(rules) {
|
|||
|
||||
lastIndex = index;
|
||||
|
||||
if (tokens.length > MAX_TOKEN_COUNT) {
|
||||
if (matchAttempts++ > MAX_TOKEN_COUNT) {
|
||||
if (matchAttempts > 2 * line.length) {
|
||||
this.reportError("infinite loop with in ace tokenizer", {
|
||||
startState: startState,
|
||||
line: line
|
||||
});
|
||||
}
|
||||
// chrome doens't show contents of text nodes with very long text
|
||||
while (lastIndex < line.length) {
|
||||
if (token.type)
|
||||
|
|
@ -343,7 +352,14 @@ var Tokenizer = function(rules) {
|
|||
state : stack.length ? stack : currentState
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
this.reportError = function(msg, data) {
|
||||
var e = new Error(msg);
|
||||
e.data = data;
|
||||
if (typeof console == "object" && console.error)
|
||||
console.error(e);
|
||||
setTimeout(function() { throw e; });
|
||||
};
|
||||
}).call(Tokenizer.prototype);
|
||||
|
||||
exports.Tokenizer = Tokenizer;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
require("amd-loader");
|
||||
require("amd-loader");
|
||||
}
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
|
@ -59,7 +59,35 @@ module.exports = {
|
|||
var t = new Tokenizer({});
|
||||
var re = t.removeCapturingGroups("(ax(by))[()]");
|
||||
assert.equal(re, "(?:ax(?:by))[()]");
|
||||
}
|
||||
},
|
||||
|
||||
"test: broken highlight rules": function() {
|
||||
var t = new Tokenizer({
|
||||
start: [{
|
||||
token: 's',
|
||||
regex: '&&&|^^^'
|
||||
}, {
|
||||
defaultToken: "def"
|
||||
}],
|
||||
state1: [{
|
||||
token: 'x',
|
||||
regex: /\b([\w]*)(\s*)((?::)?)/
|
||||
}]
|
||||
});
|
||||
var errorReports = 0;
|
||||
t.reportError = function() { errorReports++; };
|
||||
var tokens = t.getLineTokens("x|", "start");
|
||||
assert.deepEqual(tokens, {
|
||||
tokens: [{value: 'x|', type: 'overflow'}],
|
||||
state: 'start'
|
||||
});
|
||||
var tokens = t.getLineTokens("x|", "state1");
|
||||
assert.deepEqual(tokens, {
|
||||
tokens: [{value: 'x', type: 'x'}, {value: '|', type: 'overflow'}],
|
||||
state: 'start'
|
||||
});
|
||||
assert.equal(errorReports, 2);
|
||||
},
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -958,23 +958,24 @@ var VirtualRenderer = function(container, theme) {
|
|||
this.scrollBarH.setVisible(horizScroll);
|
||||
}
|
||||
|
||||
if (!this.$maxLines && this.$scrollPastEnd) {
|
||||
maxHeight += (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd;
|
||||
}
|
||||
|
||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||
size.scrollerHeight - maxHeight < 0);
|
||||
var vScrollChanged = this.$vScroll !== vScroll;
|
||||
if (vScrollChanged) {
|
||||
this.$vScroll = vScroll;
|
||||
this.scrollBarV.setVisible(vScroll);
|
||||
}
|
||||
var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd
|
||||
? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
|
||||
: 0;
|
||||
maxHeight += scrollPastEnd;
|
||||
|
||||
this.session.setScrollTop(Math.max(-this.scrollMargin.top,
|
||||
Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom)));
|
||||
|
||||
this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft,
|
||||
longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right)));
|
||||
|
||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||
size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop);
|
||||
var vScrollChanged = this.$vScroll !== vScroll;
|
||||
if (vScrollChanged) {
|
||||
this.$vScroll = vScroll;
|
||||
this.scrollBarV.setVisible(vScroll);
|
||||
}
|
||||
|
||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||
|
|
|
|||
12
package.json
12
package.json
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"name": "ace",
|
||||
"description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE",
|
||||
"version": "1.0.0",
|
||||
"homepage" : "http://github.com/ajaxorg/ace",
|
||||
"version": "1.1.8",
|
||||
"homepage": "http://github.com/ajaxorg/ace",
|
||||
"engines": {"node": ">= 0.6.0"},
|
||||
"author": "Fabian Jakobs <fabian@c9.io>",
|
||||
"main": "lib/ace",
|
||||
"repository" : {
|
||||
"type" : "git",
|
||||
"url" : "http://github.com/ajaxorg/ace.git"
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/ajaxorg/ace.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"mime": "1.2.x"
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"jsdom": "0.2.x",
|
||||
"amd-loader": "~0.0.4",
|
||||
"dryice": "0.4.11",
|
||||
"architect-build": "https://github.com/c9/architect-build/tarball/42723e152bb"
|
||||
"architect-build": "https://github.com/c9/architect-build/tarball/a3bad51808"
|
||||
},
|
||||
"mappings": {
|
||||
"ace": "."
|
||||
|
|
|
|||
74
tool/release.sh
Normal file
74
tool/release.sh
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
pause() {
|
||||
while true; do
|
||||
read -p "$1 " yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
read -p "enter version number for the build " VERSION_NUM
|
||||
|
||||
cd `dirname $0`/..
|
||||
SOURCE=`pwd`
|
||||
|
||||
node -e "
|
||||
var fs = require('fs');
|
||||
var version = '$VERSION_NUM';
|
||||
function replaceVersion(str) {
|
||||
return str.replace(/(['\"]?version['\"]?\s*[:=]\s*['\"])[\\d.\\w\\-]+(['\"])/, function(_, m1, m2) {
|
||||
return m1 + version + m2;
|
||||
});
|
||||
}
|
||||
function update(path, replace) {
|
||||
var pkg = fs.readFileSync(path, 'utf8');
|
||||
pkg = (replace || replaceVersion)(pkg);
|
||||
fs.writeFileSync(path, pkg, 'utf8');
|
||||
}
|
||||
update('package.json');
|
||||
update('build/package.json');
|
||||
update('./lib/ace/ext/menu_tools/generate_settings_menu.js');
|
||||
update('ChangeLog.txt', function(str) {
|
||||
var date='"`date +%Y.%m.%d`"';
|
||||
return date + ' Version ' + version + '\n' + str.replace(/^\d+.*/, '').replace(/^\n/, '');
|
||||
});
|
||||
"
|
||||
|
||||
pause "versions updated. do you want to start build script? [y/n]"
|
||||
|
||||
node Makefile.dryice.js full
|
||||
cd build
|
||||
git add .
|
||||
git commit --all -m "package `date +%d.%m.%y`"
|
||||
|
||||
|
||||
echo "build task completed."
|
||||
pause "continue creating the tag for v$VERSION_NUM [y/n]"
|
||||
if [[ ${VERSION_NUM} != *"-"* ]]; then
|
||||
git tag "v"$VERSION_NUM
|
||||
fi
|
||||
|
||||
pause "continue pushing to github? [y/n]"
|
||||
|
||||
git push --progress --tags "origin" HEAD:gh-pages HEAD:master
|
||||
|
||||
echo "build repository updated"
|
||||
|
||||
pause "continue update ace repo? [y/n]"
|
||||
cd ..
|
||||
|
||||
|
||||
echo "new commit added"
|
||||
pause "continue creating the tag for v$VERSION_NUM [y/n]"
|
||||
if [[ ${VERSION_NUM} != *"-"* ]]; then
|
||||
git tag "v"$VERSION_NUM
|
||||
fi
|
||||
|
||||
pause "continue pushing to github? [y/n]"
|
||||
|
||||
git push --progress --tags "origin" HEAD:gh-pages HEAD:master
|
||||
echo "All done!"
|
||||
pause "May I go now? [y/n]"
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ function convertToNonCapturingGroups(str) {
|
|||
|
||||
function simplifyNonCapturingGroups(str) {
|
||||
var tokens = tokenize(str);
|
||||
var t = tokens[0];
|
||||
var t = tokens[0] || {};
|
||||
if (t.type == "group.start" && t.value == "(?:"
|
||||
&& t.end == last(tokens)) {
|
||||
t.value = t.end.value = "";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env node
|
||||
var x;
|
||||
eval("x= " + require("fs").readFileSync(__dirname + "/package.json"))
|
||||
console.log(x.version)
|
||||
x = require('./package');
|
||||
console.log(x.version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue