This commit is contained in:
Fabian Jakobs 2011-08-18 13:04:33 +02:00
commit ce7014a780
20 changed files with 70 additions and 512 deletions

View file

@ -7324,11 +7324,9 @@ var Editor =function(renderer, session) {
session.remove(new Range(row, 0, row, i));
}
session.indentRows(cursor.row + 1, end.row, lineIndent);
} else {
if (shouldOutdent) {
mode.autoOutdent(lineState, session, cursor.row);
}
}
if (shouldOutdent)
mode.autoOutdent(lineState, session, cursor.row);
};
this.onTextInput = function(text, notPasted) {
@ -10049,9 +10047,8 @@ var EditSession = function(text, mode) {
this.indentRows = function(startRow, endRow, indentString) {
indentString = indentString.replace(/\t/g, this.getTabString());
for (var row=startRow; row<=endRow; row++) {
for (var row=startRow; row<=endRow; row++)
this.insert({row: row, column:0}, indentString);
}
};
this.outdentRows = function (range) {
@ -16455,13 +16452,13 @@ oop.inherits(Mode, TextMode);
return indent;
}
if (state == "start") {
if (state == "start" || state == "regex_allowed") {
var match = line.match(/^.*[\{\(\[\:]\s*$/);
if (match) {
indent += tab;
}
} else if (state == "doc-start") {
if (endState == "start") {
if (endState == "start" || state == "regex_allowed") {
return "";
}
var match = line.match(/^\s*(\/?)\*/);
@ -18812,7 +18809,6 @@ var Range = require("ace/range").Range;
var Mode = function() {
this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules());
this.$outdent = new MatchingBraceOutdent();
};
oop.inherits(Mode, TextMode);
@ -18868,12 +18864,43 @@ oop.inherits(Mode, TextMode);
return indent;
};
var outdents = {
"pass": 1,
"return": 1,
"raise": 1,
"break": 1,
"continue": 1
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
if (input !== "\r\n" && input !== "\r" && input !== "\n")
return false;
var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
if (!tokens)
return false;
// ignore trailing comments
do {
var last = tokens.pop();
} while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
if (!last)
return false;
return (last.type == "keyword" && outdents[last.value]);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
// outdenting in python is slightly different because it always applies
// to the next line and only of a new line is inserted
row += 1;
var indent = this.$getIndent(doc.getLine(row));
var tab = doc.getTabString();
if (indent.slice(-tab.length) == tab)
doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
};
}).call(Mode.prototype);
@ -24866,18 +24893,19 @@ define("text!demo/docs/python.py", [], "#!/usr/local/bin/python\n" +
"\n" +
"# If no arguments were given, print a helpful message\n" +
"if len(sys.argv)==1:\n" +
"print 'Usage: celsius temp1 temp2 ...'\n" +
"print '''Usage:\n" +
" celsius temp1 temp2 ...'''\n" +
"sys.exit(0)\n" +
"\n" +
"# Loop over the arguments\n" +
"for i in sys.argv[1:]:\n" +
"try:\n" +
" fahrenheit=float(string.atoi(i))\n" +
"except string.atoi_error:\n" +
" print repr(i), \"not a numeric value\"\n" +
"else:\n" +
" celsius=(fahrenheit-32)*5.0/9.0\n" +
" print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))");
" try:\n" +
" fahrenheit=float(string.atoi(i))\n" +
" except string.atoi_error:\n" +
" print repr(i), \"not a numeric value\"\n" +
" else:\n" +
" celsius=(fahrenheit-32)*5.0/9.0\n" +
" print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))");
define("text!demo/docs/ruby.rb", [], "#!/usr/bin/ruby\n" +
"\n" +
@ -25255,238 +25283,6 @@ define("text!build/demo/styles.css", [], "html {\n" +
" text-align: left;\n" +
"}");
define("text!build/textarea/style.css", [], "body {\n" +
" margin:0;\n" +
" padding:0;\n" +
" background-color:#e6f5fc;\n" +
" \n" +
"}\n" +
"\n" +
"H2, H3, H4 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" margin:0;\n" +
" padding:0;\n" +
"}\n" +
"\n" +
"H2 {\n" +
" font-size:28px;\n" +
" color:#263842;\n" +
" padding-bottom:6px;\n" +
"}\n" +
"\n" +
"H3 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" font-size:22px;\n" +
" color:#253741;\n" +
" margin-top:43px;\n" +
" margin-bottom:8px;\n" +
"}\n" +
"\n" +
"H4 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" font-size:21px;\n" +
" color:#222222;\n" +
" margin-bottom:4px;\n" +
"}\n" +
"\n" +
"P {\n" +
" padding:13px 0;\n" +
" margin:0;\n" +
" line-height:22px;\n" +
"}\n" +
"\n" +
"UL{\n" +
" line-height : 22px;\n" +
"}\n" +
"\n" +
"PRE{\n" +
" background : #333;\n" +
" color : white;\n" +
" padding : 10px;\n" +
"}\n" +
"\n" +
"#header {\n" +
" height : 227px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" background: url(images/background.png) repeat-x 0 0;\n" +
" border-bottom:1px solid #c9e8fa; \n" +
"}\n" +
"\n" +
"#header .content .signature {\n" +
" font-family:Trebuchet MS;\n" +
" font-size:11px;\n" +
" color:#ebe4d6;\n" +
" position:absolute;\n" +
" bottom:5px;\n" +
" right:42px;\n" +
" letter-spacing : 1px;\n" +
"}\n" +
"\n" +
".content {\n" +
" width:970px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" margin:0 auto;\n" +
"}\n" +
"\n" +
"#header .content {\n" +
" height:184px;\n" +
" margin-top:22px;\n" +
"}\n" +
"\n" +
"#header .content .logo {\n" +
" width : 282px;\n" +
" height : 184px;\n" +
" background:url(images/logo.png) no-repeat 0 0;\n" +
" position:absolute;\n" +
" top:0;\n" +
" left:0;\n" +
"}\n" +
"\n" +
"#header .content .title {\n" +
" width : 605px;\n" +
" height : 58px;\n" +
" background:url(images/ace.png) no-repeat 0 0;\n" +
" position:absolute;\n" +
" top:98px;\n" +
" left:329px;\n" +
"}\n" +
"\n" +
"#wrapper {\n" +
" background:url(images/body_background.png) repeat-x 0 0;\n" +
" min-height:250px;\n" +
"}\n" +
"\n" +
"#wrapper .content {\n" +
" font-family:Arial;\n" +
" font-size:14px;\n" +
" color:#222222;\n" +
" width:1000px;\n" +
"}\n" +
"\n" +
"#wrapper .content .column1 {\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" float:left;\n" +
" width:315px;\n" +
" margin-right:31px;\n" +
"}\n" +
"\n" +
"#wrapper .content .column2 {\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" float:left;\n" +
" width:600px;\n" +
" padding-top:47px;\n" +
"}\n" +
"\n" +
".fork_on_github {\n" +
" width:310px;\n" +
" height:80px;\n" +
" background:url(images/fork_on_github.png) no-repeat 0 0;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" margin-top:49px;\n" +
" cursor:pointer;\n" +
"}\n" +
"\n" +
".fork_on_github:hover {\n" +
" background-position:0 -80px;\n" +
"}\n" +
"\n" +
".divider {\n" +
" height:3px;\n" +
" background-color:#bedaea;\n" +
" margin-bottom:3px;\n" +
"}\n" +
"\n" +
".menu {\n" +
" padding:23px 0 0 24px;\n" +
"}\n" +
"\n" +
"UL.content-list {\n" +
" padding:15px;\n" +
" margin:0;\n" +
"}\n" +
"\n" +
"UL.menu-list {\n" +
" padding:0;\n" +
" margin:0 0 20px 0;\n" +
" list-style-type:none;\n" +
" line-height : 16px;\n" +
"}\n" +
"\n" +
"UL.menu-list LI {\n" +
" color:#2557b4;\n" +
" font-family:Trebuchet MS;\n" +
" font-size:14px;\n" +
" padding:7px 0;\n" +
" border-bottom:1px dotted #d6e2e7;\n" +
"}\n" +
"\n" +
"UL.menu-list LI:last-child {\n" +
" border-bottom:0;\n" +
"}\n" +
"\n" +
"A {\n" +
" color:#2557b4;\n" +
" text-decoration:none;\n" +
"}\n" +
"\n" +
"A:hover {\n" +
" text-decoration:underline;\n" +
"}\n" +
"\n" +
"P#first{\n" +
" background : rgba(255,255,255,0.5);\n" +
" padding : 20px;\n" +
" font-size : 16px;\n" +
" line-height : 24px;\n" +
" margin : 0 0 20px 0;\n" +
"}\n" +
"\n" +
"#footer {\n" +
" height:40px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" background:url(images/bottombar.png) repeat-x 0 0;\n" +
" position:relative;\n" +
" margin-top:40px;\n" +
"}\n" +
"\n" +
"UL.menu-footer {\n" +
" padding:0;\n" +
" margin:8px 11px 0 0;\n" +
" list-style-type:none;\n" +
" float:right;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI {\n" +
" color:white;\n" +
" font-family:Arial;\n" +
" font-size:12px;\n" +
" display:inline-block;\n" +
" margin:0 1px;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI A {\n" +
" color:#8dd0ff;\n" +
" text-decoration:none;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI A:hover {\n" +
" text-decoration:underline;\n" +
"}\n" +
"\n" +
"\n" +
"\n" +
"\n" +
"");
define("text!build_support/style.css", [], "body {\n" +
" margin:0;\n" +
" padding:0;\n" +

File diff suppressed because one or more lines are too long

View file

@ -6084,11 +6084,9 @@ var Editor =function(renderer, session) {
session.remove(new Range(row, 0, row, i));
}
session.indentRows(cursor.row + 1, end.row, lineIndent);
} else {
if (shouldOutdent) {
mode.autoOutdent(lineState, session, cursor.row);
}
}
if (shouldOutdent)
mode.autoOutdent(lineState, session, cursor.row);
};
this.onTextInput = function(text, notPasted) {
@ -8809,9 +8807,8 @@ var EditSession = function(text, mode) {
this.indentRows = function(startRow, endRow, indentString) {
indentString = indentString.replace(/\t/g, this.getTabString());
for (var row=startRow; row<=endRow; row++) {
for (var row=startRow; row<=endRow; row++)
this.insert({row: row, column:0}, indentString);
}
};
this.outdentRows = function (range) {
@ -15788,238 +15785,6 @@ define("text!build/demo/styles.css", [], "html {\n" +
" text-align: left;\n" +
"}");
define("text!build/textarea/style.css", [], "body {\n" +
" margin:0;\n" +
" padding:0;\n" +
" background-color:#e6f5fc;\n" +
" \n" +
"}\n" +
"\n" +
"H2, H3, H4 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" margin:0;\n" +
" padding:0;\n" +
"}\n" +
"\n" +
"H2 {\n" +
" font-size:28px;\n" +
" color:#263842;\n" +
" padding-bottom:6px;\n" +
"}\n" +
"\n" +
"H3 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" font-size:22px;\n" +
" color:#253741;\n" +
" margin-top:43px;\n" +
" margin-bottom:8px;\n" +
"}\n" +
"\n" +
"H4 {\n" +
" font-family:Trebuchet MS;\n" +
" font-weight:bold;\n" +
" font-size:21px;\n" +
" color:#222222;\n" +
" margin-bottom:4px;\n" +
"}\n" +
"\n" +
"P {\n" +
" padding:13px 0;\n" +
" margin:0;\n" +
" line-height:22px;\n" +
"}\n" +
"\n" +
"UL{\n" +
" line-height : 22px;\n" +
"}\n" +
"\n" +
"PRE{\n" +
" background : #333;\n" +
" color : white;\n" +
" padding : 10px;\n" +
"}\n" +
"\n" +
"#header {\n" +
" height : 227px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" background: url(images/background.png) repeat-x 0 0;\n" +
" border-bottom:1px solid #c9e8fa; \n" +
"}\n" +
"\n" +
"#header .content .signature {\n" +
" font-family:Trebuchet MS;\n" +
" font-size:11px;\n" +
" color:#ebe4d6;\n" +
" position:absolute;\n" +
" bottom:5px;\n" +
" right:42px;\n" +
" letter-spacing : 1px;\n" +
"}\n" +
"\n" +
".content {\n" +
" width:970px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" margin:0 auto;\n" +
"}\n" +
"\n" +
"#header .content {\n" +
" height:184px;\n" +
" margin-top:22px;\n" +
"}\n" +
"\n" +
"#header .content .logo {\n" +
" width : 282px;\n" +
" height : 184px;\n" +
" background:url(images/logo.png) no-repeat 0 0;\n" +
" position:absolute;\n" +
" top:0;\n" +
" left:0;\n" +
"}\n" +
"\n" +
"#header .content .title {\n" +
" width : 605px;\n" +
" height : 58px;\n" +
" background:url(images/ace.png) no-repeat 0 0;\n" +
" position:absolute;\n" +
" top:98px;\n" +
" left:329px;\n" +
"}\n" +
"\n" +
"#wrapper {\n" +
" background:url(images/body_background.png) repeat-x 0 0;\n" +
" min-height:250px;\n" +
"}\n" +
"\n" +
"#wrapper .content {\n" +
" font-family:Arial;\n" +
" font-size:14px;\n" +
" color:#222222;\n" +
" width:1000px;\n" +
"}\n" +
"\n" +
"#wrapper .content .column1 {\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" float:left;\n" +
" width:315px;\n" +
" margin-right:31px;\n" +
"}\n" +
"\n" +
"#wrapper .content .column2 {\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" float:left;\n" +
" width:600px;\n" +
" padding-top:47px;\n" +
"}\n" +
"\n" +
".fork_on_github {\n" +
" width:310px;\n" +
" height:80px;\n" +
" background:url(images/fork_on_github.png) no-repeat 0 0;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" margin-top:49px;\n" +
" cursor:pointer;\n" +
"}\n" +
"\n" +
".fork_on_github:hover {\n" +
" background-position:0 -80px;\n" +
"}\n" +
"\n" +
".divider {\n" +
" height:3px;\n" +
" background-color:#bedaea;\n" +
" margin-bottom:3px;\n" +
"}\n" +
"\n" +
".menu {\n" +
" padding:23px 0 0 24px;\n" +
"}\n" +
"\n" +
"UL.content-list {\n" +
" padding:15px;\n" +
" margin:0;\n" +
"}\n" +
"\n" +
"UL.menu-list {\n" +
" padding:0;\n" +
" margin:0 0 20px 0;\n" +
" list-style-type:none;\n" +
" line-height : 16px;\n" +
"}\n" +
"\n" +
"UL.menu-list LI {\n" +
" color:#2557b4;\n" +
" font-family:Trebuchet MS;\n" +
" font-size:14px;\n" +
" padding:7px 0;\n" +
" border-bottom:1px dotted #d6e2e7;\n" +
"}\n" +
"\n" +
"UL.menu-list LI:last-child {\n" +
" border-bottom:0;\n" +
"}\n" +
"\n" +
"A {\n" +
" color:#2557b4;\n" +
" text-decoration:none;\n" +
"}\n" +
"\n" +
"A:hover {\n" +
" text-decoration:underline;\n" +
"}\n" +
"\n" +
"P#first{\n" +
" background : rgba(255,255,255,0.5);\n" +
" padding : 20px;\n" +
" font-size : 16px;\n" +
" line-height : 24px;\n" +
" margin : 0 0 20px 0;\n" +
"}\n" +
"\n" +
"#footer {\n" +
" height:40px;\n" +
" position:relative;\n" +
" overflow:hidden;\n" +
" background:url(images/bottombar.png) repeat-x 0 0;\n" +
" position:relative;\n" +
" margin-top:40px;\n" +
"}\n" +
"\n" +
"UL.menu-footer {\n" +
" padding:0;\n" +
" margin:8px 11px 0 0;\n" +
" list-style-type:none;\n" +
" float:right;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI {\n" +
" color:white;\n" +
" font-family:Arial;\n" +
" font-size:12px;\n" +
" display:inline-block;\n" +
" margin:0 1px;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI A {\n" +
" color:#8dd0ff;\n" +
" text-decoration:none;\n" +
"}\n" +
"\n" +
"UL.menu-footer LI A:hover {\n" +
" text-decoration:underline;\n" +
"}\n" +
"\n" +
"\n" +
"\n" +
"\n" +
"");
define("text!build_support/style.css", [], "body {\n" +
" margin:0;\n" +
" padding:0;\n" +

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})
define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if(d!=="\r\n"&&d!=="\r"&&d!=="\n")return!1;var e=this.$tokenizer.getLineTokens(c.trim(),b).tokens;if(!e)return!1;do var f=e.pop();while(f&&(f.type=="comment"||f.type=="text"&&f.value.match(/^\s+$/)));return f?f.type=="keyword"&&a[f.value]:!1},this.autoOutdent=function(a,b,c){c+=1;var d=this.$getIndent(b.getLine(c)),e=b.getTabString();d.slice(-e.length)==e&&b.remove(new i(c,d.length-e.length,c,d.length))}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -6073,11 +6073,9 @@ var Editor =function(renderer, session) {
session.remove(new Range(row, 0, row, i));
}
session.indentRows(cursor.row + 1, end.row, lineIndent);
} else {
if (shouldOutdent) {
mode.autoOutdent(lineState, session, cursor.row);
}
}
if (shouldOutdent)
mode.autoOutdent(lineState, session, cursor.row);
};
this.onTextInput = function(text, notPasted) {
@ -8798,9 +8796,8 @@ var EditSession = function(text, mode) {
this.indentRows = function(startRow, endRow, indentString) {
indentString = indentString.replace(/\t/g, this.getTabString());
for (var row=startRow; row<=endRow; row++) {
for (var row=startRow; row<=endRow; row++)
this.insert({row: row, column:0}, indentString);
}
};
this.outdentRows = function (range) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
__ace_shadowed__.define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),__ace_shadowed__.define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),__ace_shadowed__.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})
__ace_shadowed__.define("ace/mode/python",["require","exports","module","pilot/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules())};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if(d!=="\r\n"&&d!=="\r"&&d!=="\n")return!1;var e=this.$tokenizer.getLineTokens(c.trim(),b).tokens;if(!e)return!1;do var f=e.pop();while(f&&(f.type=="comment"||f.type=="text"&&f.value.match(/^\s+$/)));return f?f.type=="keyword"&&a[f.value]:!1},this.autoOutdent=function(a,b,c){c+=1;var d=this.$getIndent(b.getLine(c)),e=b.getTabString();d.slice(-e.length)==e&&b.remove(new i(c,d.length-e.length,c,d.length))}}.call(j.prototype),b.Mode=j}),__ace_shadowed__.define("ace/mode/python_highlight_rules",["require","exports","module","pilot/oop","pilot/lang","ace/mode/text_highlight_rules"],function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",merge:!0,regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",merge:!0,regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",merge:!0,regex:".+"}]}};d.inherits(g,f),b.PythonHighlightRules=g}),__ace_shadowed__.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){var d=a("ace/range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long