Add missing $id to those Modes that are missing it.
I've found that the set of modes in this PR did not set their `$id`.
The side-effect of that is that when one of these modes is the current
mode of an EditSession, and one calls `session.getOption('mode')` the
returned value was incorrect. It goes up the prototype chain so you'd
get something like 'ace/mode/text' or 'ace/mode/html' in most cases.
This fixes that so that if, for example, the mode is set to
'ace/mode/django', the value returned by the option will be
'ace/mode/django'
This commit is contained in:
parent
5abba7d32c
commit
6e1aefff56
8 changed files with 23 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.lineCommentStart = "#";
|
this.lineCommentStart = "#";
|
||||||
|
this.$id = "ace/mode/apache_conf";
|
||||||
// Extra logic goes here.
|
// Extra logic goes here.
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,5 +112,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, HtmlMode);
|
oop.inherits(Mode, HtmlMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/django";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -49,5 +49,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, CMode);
|
oop.inherits(Mode, CMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/glsl";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ define(function(require, exports, module){
|
||||||
if (that = require('../mode/matching_brace_outdent')) {
|
if (that = require('../mode/matching_brace_outdent')) {
|
||||||
this.$outdent = new that.MatchingBraceOutdent;
|
this.$outdent = new that.MatchingBraceOutdent;
|
||||||
}
|
}
|
||||||
|
this.$id = "ace/mode/livescript";
|
||||||
}
|
}
|
||||||
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
||||||
prototype.getNextLineIndent = function(state, line, tab){
|
prototype.getNextLineIndent = function(state, line, tab){
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, HtmlMode);
|
oop.inherits(Mode, HtmlMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/luapage";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -12,5 +12,9 @@ var Mode = function() {
|
||||||
|
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/lucene";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -49,7 +49,7 @@ oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
this.lineCommentStart = "//";
|
this.lineCommentStart = "//";
|
||||||
this.blockComment = {start: "/*", end: "*/"};
|
this.blockComment = {start: "/*", end: "*/"};
|
||||||
|
this.$id = "ace/mode/mel";
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
|
|
|
||||||
|
|
@ -41,5 +41,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/properties";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue