Fix line endings
This commit is contained in:
@@ -1,58 +1,58 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is Ajax.org Code Editor (ACE).
|
* The Original Code is Ajax.org Code Editor (ACE).
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is
|
* The Initial Developer of the Original Code is
|
||||||
* Ajax.org B.V.
|
* Ajax.org B.V.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("../lib/oop");
|
var oop = require("../lib/oop");
|
||||||
var TextMode = require("./text").Mode;
|
var TextMode = require("./text").Mode;
|
||||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
|
var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
|
||||||
var FoldMode = require("./folding/diff").FoldMode;
|
var FoldMode = require("./folding/diff").FoldMode;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function() {
|
||||||
this.$tokenizer = new Tokenizer(new HighlightRules().getRules(), "i");
|
this.$tokenizer = new Tokenizer(new HighlightRules().getRules(), "i");
|
||||||
this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i");
|
this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i");
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+108
-108
@@ -1,108 +1,108 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is Ajax.org Code Editor (ACE).
|
* The Original Code is Ajax.org Code Editor (ACE).
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is
|
* The Initial Developer of the Original Code is
|
||||||
* Ajax.org B.V.
|
* Ajax.org B.V.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("../lib/oop");
|
var oop = require("../lib/oop");
|
||||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
var DiffHighlightRules = function() {
|
var DiffHighlightRules = function() {
|
||||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||||
// regexps are ordered -> the first match is used
|
// regexps are ordered -> the first match is used
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
"start" : [{
|
"start" : [{
|
||||||
"regex": "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
|
"regex": "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
|
||||||
"token": "punctuation.definition.separator.diff",
|
"token": "punctuation.definition.separator.diff",
|
||||||
"name": "keyword"
|
"name": "keyword"
|
||||||
}, { //diff.range.unified
|
}, { //diff.range.unified
|
||||||
"regex": "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
|
"regex": "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
|
||||||
"token": [
|
"token": [
|
||||||
"constant",
|
"constant",
|
||||||
"constant.numeric",
|
"constant.numeric",
|
||||||
"constant",
|
"constant",
|
||||||
"comment.doc.tag"
|
"comment.doc.tag"
|
||||||
]
|
]
|
||||||
}, { //diff.range.normal
|
}, { //diff.range.normal
|
||||||
"regex": "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
|
"regex": "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
|
||||||
"token": [
|
"token": [
|
||||||
"constant.numeric",
|
"constant.numeric",
|
||||||
"punctuation.definition.range.diff",
|
"punctuation.definition.range.diff",
|
||||||
"constant.function",
|
"constant.function",
|
||||||
"constant.numeric",
|
"constant.numeric",
|
||||||
"punctuation.definition.range.diff",
|
"punctuation.definition.range.diff",
|
||||||
"invalid"
|
"invalid"
|
||||||
],
|
],
|
||||||
"name": "meta."
|
"name": "meta."
|
||||||
}, {
|
}, {
|
||||||
"regex": "^(?:(\\-{3}|\\+{3}|\\*{3})( .+))$",
|
"regex": "^(?:(\\-{3}|\\+{3}|\\*{3})( .+))$",
|
||||||
"token": [
|
"token": [
|
||||||
"constant.numeric",
|
"constant.numeric",
|
||||||
"meta.tag"
|
"meta.tag"
|
||||||
]
|
]
|
||||||
}, { // added
|
}, { // added
|
||||||
"regex": "^([!+>])(.*?)(\\s*)$",
|
"regex": "^([!+>])(.*?)(\\s*)$",
|
||||||
"token": [
|
"token": [
|
||||||
"support.constant",
|
"support.constant",
|
||||||
"text",
|
"text",
|
||||||
"invalid"
|
"invalid"
|
||||||
],
|
],
|
||||||
}, { // removed
|
}, { // removed
|
||||||
"regex": "^([<\\-])(.*?)(\\s*)$",
|
"regex": "^([<\\-])(.*?)(\\s*)$",
|
||||||
"token": [
|
"token": [
|
||||||
"support.function",
|
"support.function",
|
||||||
"string",
|
"string",
|
||||||
"invalid"
|
"invalid"
|
||||||
],
|
],
|
||||||
}, {
|
}, {
|
||||||
"regex": "^(diff)(\\s+--\\w+)?(.+?)( .+)?$",
|
"regex": "^(diff)(\\s+--\\w+)?(.+?)( .+)?$",
|
||||||
"token": ["variable", "variable", "keyword", "variable"]
|
"token": ["variable", "variable", "keyword", "variable"]
|
||||||
}, {
|
}, {
|
||||||
"regex": "^Index.+$",
|
"regex": "^Index.+$",
|
||||||
"token": "variable"
|
"token": "variable"
|
||||||
}, {
|
}, {
|
||||||
"regex": "^(.*?)(\\s*)$",
|
"regex": "^(.*?)(\\s*)$",
|
||||||
"token": ["invisible", "invalid"]
|
"token": ["invisible", "invalid"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(DiffHighlightRules, TextHighlightRules);
|
oop.inherits(DiffHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
exports.DiffHighlightRules = DiffHighlightRules;
|
exports.DiffHighlightRules = DiffHighlightRules;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user