Updated Ace version.

This commit is contained in:
Thomas Wilburn 2014-10-09 07:34:48 -07:00
parent b2aeff6af9
commit 91cdb39e9e
30 changed files with 423 additions and 121 deletions

View file

@ -3,7 +3,7 @@
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
@ -14,7 +14,7 @@
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -65,7 +65,7 @@ var _define = function(module, deps, payload) {
_define.modules = {};
_define.payloads = {};
}
_define.payloads[module] = payload;
_define.modules[module] = null;
};
@ -160,7 +160,7 @@ var lookup = function(parentId, moduleName) {
function exportAce(ns) {
var require = function(module, callback) {
return _require("", module, callback);
};
};
var root = global;
if (ns) {
@ -1937,13 +1937,13 @@ var TextInput = function(parentNode, host) {
var isSelectionEmpty = true;
try { var isFocused = document.activeElement === text; } catch(e) {}
event.addListener(text, "blur", function() {
host.onBlur();
event.addListener(text, "blur", function(e) {
host.onBlur(e);
isFocused = false;
});
event.addListener(text, "focus", function() {
event.addListener(text, "focus", function(e) {
isFocused = true;
host.onFocus();
host.onFocus(e);
resetSelection();
});
this.focus = function() { text.focus(); };
@ -7334,12 +7334,11 @@ function Folding() {
if (startFold && endFold == startFold)
return startFold.addSubFold(fold);
if (
(startFold && !startFold.range.isStart(startRow, startColumn))
|| (endFold && !endFold.range.isEnd(endRow, endColumn))
) {
throw new Error("A fold can't intersect already existing fold" + fold.range + startFold.range);
}
if (startFold && !startFold.range.isStart(startRow, startColumn))
this.removeFold(startFold);
if (endFold && !endFold.range.isEnd(endRow, endColumn))
this.removeFold(endFold);
var folds = this.getFoldsInRange(fold.range);
if (folds.length > 0) {
this.removeFolds(folds);
@ -9941,7 +9940,7 @@ var Search = function() {
if (options.wholeWord)
needle = "\\b" + needle + "\\b";
var modifier = options.caseSensitive ? "g" : "gi";
var modifier = options.caseSensitive ? "gm" : "gmi";
options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle);
if (options.$isMultiLine)
@ -11431,21 +11430,21 @@ var Editor = function(renderer, session) {
this.blur = function() {
this.textInput.blur();
};
this.onFocus = function() {
this.onFocus = function(e) {
if (this.$isFocused)
return;
this.$isFocused = true;
this.renderer.showCursor();
this.renderer.visualizeFocus();
this._emit("focus");
this._emit("focus", e);
};
this.onBlur = function() {
this.onBlur = function(e) {
if (!this.$isFocused)
return;
this.$isFocused = false;
this.renderer.hideCursor();
this.renderer.visualizeBlur();
this._emit("blur");
this._emit("blur", e);
};
this.$cursorChange = function() {
@ -12663,7 +12662,9 @@ var Editor = function(renderer, session) {
rect = self.renderer.container.getBoundingClientRect();
});
var onAfterRender = this.renderer.on("afterRender", function() {
if (shouldScroll && rect && self.isFocused()) {
if (shouldScroll && rect && (self.isFocused()
|| self.searchBox && self.searchBox.isFocused())
) {
var renderer = self.renderer;
var pos = renderer.$cursorLayer.$pixelPos;
var config = renderer.layerConfig;
@ -16005,14 +16006,9 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
this.onMessage = function(e) {
var msg = e.data;
switch(msg.type) {
case "log":
window.console && console.log && console.log.apply(console, msg.data);
break;
case "event":
this._signal(msg.name, {data: msg.data});
break;
case "call":
var callback = this.callbacks[msg.id];
if (callback) {
@ -16020,8 +16016,18 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
delete this.callbacks[msg.id];
}
break;
case "error":
this.reportError(msg.data);
break;
case "log":
window.console && console.log && console.log.apply(console, msg.data);
break;
}
};
this.reportError = function(err) {
window.console && console.error && console.error(err);
};
this.$normalizePath = function(path) {
return net.qualifyURL(path);
@ -16032,7 +16038,8 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
this.deltaQueue = null;
this.$worker.terminate();
this.$worker = null;
this.$doc.removeEventListener("change", this.changeListener);
if (this.$doc)
this.$doc.off("change", this.changeListener);
this.$doc = null;
};
@ -17642,9 +17649,10 @@ function LineWidgets(session) {
this.renderWidgets = this.renderWidgets.bind(this);
this.measureWidgets = this.measureWidgets.bind(this);
this.session._changedWidgets = [];
this.detach = this.detach.bind(this);
this.$onChangeEditor = this.$onChangeEditor.bind(this);
this.session.on("change", this.updateOnChange);
this.session.on("changeEditor", this.$onChangeEditor);
}
(function() {
@ -17670,8 +17678,12 @@ function LineWidgets(session) {
return screenRows;
};
this.$onChangeEditor = function(e) {
this.attach(e.editor);
};
this.attach = function(editor) {
if (editor.widgetManager && editor.widgetManager != this)
if (editor && editor.widgetManager && editor.widgetManager != this)
editor.widgetManager.detach();
if (this.editor == editor)
@ -17680,21 +17692,16 @@ function LineWidgets(session) {
this.detach();
this.editor = editor;
this.editor.on("changeSession", this.detach);
editor.widgetManager = this;
editor.renderer.on("beforeRender", this.measureWidgets);
editor.renderer.on("afterRender", this.renderWidgets);
if (editor) {
editor.widgetManager = this;
editor.renderer.on("beforeRender", this.measureWidgets);
editor.renderer.on("afterRender", this.renderWidgets);
}
};
this.detach = function(e) {
if (e && e.session == this.session)
return; // sometimes attach can be called before setSession
var editor = this.editor;
if (!editor)
return;
editor.off("changeSession", this.detach);
this.editor = null;
editor.widgetManager = null;

View file

@ -1251,7 +1251,7 @@ exports.retrieveFollowingIdentifier = function(text, pos, regex) {
});
ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/event","ace/lib/lang","ace/snippets"], function(require, exports, module) {
ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/snippets"], function(require, exports, module) {
"use strict";
var HashHandler = require("./keyboard/hash_handler").HashHandler;
@ -1259,6 +1259,7 @@ var AcePopup = require("./autocomplete/popup").AcePopup;
var util = require("./autocomplete/util");
var event = require("./lib/event");
var lang = require("./lib/lang");
var dom = require("./lib/dom");
var snippetManager = require("./snippets").snippetManager;
var Autocomplete = function() {
@ -1275,6 +1276,8 @@ var Autocomplete = function() {
this.changeTimer = lang.delayedCall(function() {
this.updateCompletions(true);
}.bind(this));
this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50);
};
(function() {
@ -1287,6 +1290,13 @@ var Autocomplete = function() {
e.stop();
}.bind(this));
this.popup.focus = this.editor.focus.bind(this.editor);
this.popup.on("select", this.tooltipTimer.bind(null, null));
this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null));
return this.popup;
};
this.getPopup = function() {
return this.popup || this.$init();
};
this.openPopup = function(editor, prefix, keepPopupPosition) {
@ -1324,6 +1334,7 @@ var Autocomplete = function() {
this.editor.off("mousedown", this.mousedownListener);
this.editor.off("mousewheel", this.mousewheelListener);
this.changeTimer.cancel();
this.hideDocTooltip();
if (this.popup && this.popup.isOpen) {
this.gatherCompletionsId += 1;
@ -1347,10 +1358,15 @@ var Autocomplete = function() {
this.detach();
};
this.blurListener = function() {
this.blurListener = function(e) {
var el = document.activeElement;
if (el != this.editor.textInput.getElement() && el.parentNode != this.popup.container)
var text = this.editor.textInput.getElement()
if (el != text && el.parentNode != this.popup.container
&& el != this.tooltipNode && e.relatedTarget != this.tooltipNode
&& e.relatedTarget != text
) {
this.detach();
}
};
this.mousedownListener = function(e) {
@ -1399,6 +1415,7 @@ var Autocomplete = function() {
this.detach();
};
this.commands = {
"Up": function(editor) { editor.completer.goTo("up"); },
"Down": function(editor) { editor.completer.goTo("down"); },
@ -1519,6 +1536,73 @@ var Autocomplete = function() {
this.cancelContextMenu = function() {
this.editor.$mouseHandler.cancelContextMenu();
};
this.updateDocTooltip = function() {
var popup = this.popup;
var all = popup.data;
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
var doc = null;
if (!selected || !this.editor || !this.popup.isOpen)
return this.hideDocTooltip();
this.editor.completers.some(function(completer) {
if (completer.getDocTooltip)
doc = completer.getDocTooltip(selected);
return doc;
});
if (!doc)
doc = selected;
if (typeof doc == "string")
doc = {tooltipText: doc}
if (!doc || !(doc.docHTML || doc.docText))
return this.hideDocTooltip();
this.showDocTooltip(doc);
};
this.showDocTooltip = function(item) {
if (!this.tooltipNode) {
this.tooltipNode = dom.createElement("pre");
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip";
this.tooltipNode.style.margin = 0;
this.tooltipNode.style.pointerEvents = "auto";
this.tooltipNode.tabIndex = -1;
this.tooltipNode.onblur = this.blurListener.bind(this);
}
var tooltipNode = this.tooltipNode;
if (item.docHTML) {
tooltipNode.innerHTML = item.docHTML;
} else if (item.docText) {
tooltipNode.textContent = item.docText;
}
if (!tooltipNode.parentNode)
document.body.appendChild(tooltipNode);
var popup = this.popup;
var rect = popup.container.getBoundingClientRect();
tooltipNode.style.top = popup.container.style.top;
tooltipNode.style.bottom = popup.container.style.bottom;
if (window.innerWidth - rect.right < 320) {
tooltipNode.style.right = window.innerWidth - rect.left + "px";
tooltipNode.style.left = "";
} else {
tooltipNode.style.left = (rect.right + 1) + "px";
tooltipNode.style.right = "";
}
tooltipNode.style.display = "block";
};
this.hideDocTooltip = function() {
this.tooltipTimer.cancel();
if (!this.tooltipNode) return;
var el = this.tooltipNode;
if (!this.editor.isFocused() && document.activeElement == el)
this.editor.focus();
this.tooltipNode = null;
if (el.parentNode)
el.parentNode.removeChild(el);
};
}).call(Autocomplete.prototype);
@ -1646,12 +1730,13 @@ ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/
};
});
ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"], function(require, exports, module) {
ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"], function(require, exports, module) {
"use strict";
var snippetManager = require("../snippets").snippetManager;
var Autocomplete = require("../autocomplete").Autocomplete;
var config = require("../config");
var lang = require("../lib/lang");
var util = require("../autocomplete/util");
var textCompleter = require("../autocomplete/text_completer");
@ -1677,15 +1762,27 @@ var snippetCompleter = {
completions.push({
caption: caption,
snippet: s.content,
meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet"
meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet",
type: "snippet"
});
}
}, this);
callback(null, completions);
},
getDocTooltip: function(item) {
if (item.type == "snippet" && !item.docHTML) {
item.docHTML = [
"<b>", lang.escapeHTML(item.caption), "</b>", "<hr></hr>",
lang.escapeHTML(item.snippet)
].join("");
}
}
};
var completers = [snippetCompleter, textCompleter, keyWordCompleter];
exports.setCompleters = function(val) {
completers = val || [];
};
exports.addCompleter = function(completer) {
completers.push(completer);
};

View file

@ -9,7 +9,7 @@ var searchboxCss = "\
background-color: #ddd;\
border: 1px solid #cbcbcb;\
border-top: 0 none;\
max-width: 297px;\
max-width: 325px;\
overflow: hidden;\
margin: 0;\
padding: 4px;\
@ -158,6 +158,7 @@ var html = '<div class="ace_search right">\
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
<button type="button" action="findNext" class="ace_searchbtn next"></button>\
<button type="button" action="findPrev" class="ace_searchbtn prev"></button>\
<button type="button" action="findAll" class="ace_searchbtn" title="Alt-Enter">All</button>\
</div>\
<div class="ace_replace_form">\
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
@ -278,6 +279,11 @@ var SearchBox = function(editor, range, showReplaceForm) {
sb.replace();
sb.findPrev();
},
"Alt-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replaceAll();
sb.findAll();
},
"Tab": function(sb) {
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
}
@ -337,6 +343,18 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.findPrev = function() {
this.find(true, true);
};
this.findAll = function(){
var range = this.editor.findAll(this.searchInput.value, {
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
this.editor._emit("findSearchBox", { match: !noMatch });
this.highlight();
this.hide();
};
this.replace = function() {
if (!this.editor.getReadOnly())
this.editor.replace(this.replaceInput.value);
@ -371,6 +389,10 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
};
this.isFocused = function() {
var el = document.activeElement;
return el == this.searchInput || el == this.replaceInput;
}
}).call(SearchBox.prototype);
exports.SearchBox = SearchBox;

View file

@ -9,7 +9,7 @@ var searchboxCss = "\
background-color: #ddd;\
border: 1px solid #cbcbcb;\
border-top: 0 none;\
max-width: 297px;\
max-width: 325px;\
overflow: hidden;\
margin: 0;\
padding: 4px;\
@ -158,6 +158,7 @@ var html = '<div class="ace_search right">\
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
<button type="button" action="findNext" class="ace_searchbtn next"></button>\
<button type="button" action="findPrev" class="ace_searchbtn prev"></button>\
<button type="button" action="findAll" class="ace_searchbtn" title="Alt-Enter">All</button>\
</div>\
<div class="ace_replace_form">\
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
@ -278,6 +279,11 @@ var SearchBox = function(editor, range, showReplaceForm) {
sb.replace();
sb.findPrev();
},
"Alt-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replaceAll();
sb.findAll();
},
"Tab": function(sb) {
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
}
@ -337,6 +343,18 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.findPrev = function() {
this.find(true, true);
};
this.findAll = function(){
var range = this.editor.findAll(this.searchInput.value, {
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
this.editor._emit("findSearchBox", { match: !noMatch });
this.highlight();
this.hide();
};
this.replace = function() {
if (!this.editor.getReadOnly())
this.editor.replace(this.replaceInput.value);
@ -371,6 +389,10 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
};
this.isFocused = function() {
var el = document.activeElement;
return el == this.searchInput || el == this.replaceInput;
}
}).call(SearchBox.prototype);
exports.SearchBox = SearchBox;

View file

@ -180,7 +180,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "/\\*";
this.lineCommentStart = ";";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/autohotkey";
}).call(Mode.prototype);

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -112,7 +112,7 @@ ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
this.next = stack.shift() || "";
if (this.next.indexOf("string") != -1)
return "paren.string";
}

View file

@ -452,7 +452,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "/\\+";
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/d";
}).call(Mode.prototype);

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -235,7 +235,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "(?<=^|\\s)\\.?\\( [^)]*\\)";
this.lineCommentStart = "--";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/forth";
}).call(Mode.prototype);

View file

@ -43,6 +43,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "#";
this.$id = "ace/mode/gitignore";
}).call(Mode.prototype);

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -1618,7 +1618,7 @@ ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
this.next = stack.shift() || "";
if (this.next.indexOf("string") != -1)
return "paren.string";
}

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -89,11 +89,12 @@ var c_cppHighlightRules = function() {
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
this.$rules = {
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
@ -160,14 +161,26 @@ var c_cppHighlightRules = function() {
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"qstring" : [
@ -176,8 +189,7 @@ var c_cppHighlightRules = function() {
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
next : "start"
}, {
token : "string",
regex : '.+'
defaultToken : "string"
}
],
"directive" : [

View file

@ -200,7 +200,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "/\\*";
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/rust";
}).call(Mode.prototype);

View file

@ -403,7 +403,10 @@ var Mode = function() {
};
oop.inherits(Mode, TextMode);
(function() {
(function() {
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/stylus";
}).call(Mode.prototype);

View file

@ -117,6 +117,7 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.type = "text";
this.getNextLineIndent = function(state, line, tab) {
if (state == "intag")
return tab;

View file

@ -4,7 +4,7 @@ exports.isDark = true;
exports.cssClass = "ace-cobalt";
exports.cssText = ".ace-cobalt .ace_gutter {\
background: #011e3a;\
color: #fff\
color: rgb(128,145,160)\
}\
.ace-cobalt .ace_print-margin {\
width: 1px;\

View file

@ -4,7 +4,7 @@ exports.isDark = true;
exports.cssClass = "ace-idle-fingers";
exports.cssText = ".ace-idle-fingers .ace_gutter {\
background: #3b3b3b;\
color: #fff\
color: rgb(153,153,153)\
}\
.ace-idle-fingers .ace_print-margin {\
width: 1px;\

View file

@ -36,7 +36,7 @@ border: 1px solid rgb(110, 119, 0);\
border-bottom: 0;\
box-shadow: inset 0 -1px rgb(110, 119, 0);\
margin: -1px 0 0 -1px;\
background: rgba(255, 235, 0, 0.1);\
background: rgba(255, 235, 0, 0.1)\
}\
.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {\
background: #2A2A2A\
@ -111,7 +111,7 @@ color: #D54E53\
color: #969896\
}\
.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {\
color: #C2C280;\
color: #C2C280\
}\
.ace-tomorrow-night-bright .ace_indent-guide {\
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -17,7 +17,13 @@ window.window = window;
window.ace = window;
window.onerror = function(message, file, line, col, err) {
console.error("Worker " + (err ? err.stack : message));
postMessage({type: "error", data: {
message: message,
file: file,
line: line,
col: col,
stack: err.stack
}});
};
window.normalizeModule = function(parentId, moduleName) {
@ -84,15 +90,20 @@ window.define = function(id, deps, factory) {
deps = [];
id = window.require.id;
}
if (typeof factory != "function") {
window.require.modules[id] = {
exports: factory,
initialized: true
};
return;
}
if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0)
return;
var req = function(childId) {
return window.require(id, childId);
};

View file

@ -1,7 +1,7 @@
{
"name": "Caret",
"description": "Professional text editing for Chrome and Chrome OS",
"version": "1.4.33",
"version": "1.4.34",
"manifest_version": 2,
"default_locale": "en",
"icons": {