mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(edit) ace v1.1.8
This commit is contained in:
parent
88b1a529b8
commit
70b91d47c3
97 changed files with 3808 additions and 4765 deletions
|
|
@ -106,9 +106,70 @@ 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"
|
||||
}]
|
||||
}],
|
||||
|
||||
{
|
||||
token : "text", // namespaces aren't symbols
|
||||
|
|
@ -277,11 +338,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};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue