Skip to content

Commit

Permalink
CodeMirror updated to 5.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
okonomiyaki3000 committed Aug 23, 2016
1 parent 8258906 commit 5d6cfe6
Show file tree
Hide file tree
Showing 33 changed files with 213 additions and 111 deletions.
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/comment/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
var line = self.getLine(i);
var found = line.indexOf(lineString);
if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
if (found == -1 && nonWS.test(line)) break lineComment;
if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
lines.push(line);
}
Expand Down
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/comment/comment.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion media/editors/codemirror/addon/edit/matchbrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@
}

CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init)
if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets);
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
}
if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets);
Expand Down
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/edit/matchbrackets.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion media/editors/codemirror/addon/hint/javascript-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@
var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");

function forAllProps(obj, callback) {
if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {
for (var name in obj) callback(name)
} else {
for (var o = obj; o; o = Object.getPrototypeOf(o))
Object.getOwnPropertyNames(o).forEach(callback)
}
}

function getCompletions(token, context, keywords, options) {
var found = [], start = token.string, global = options && options.globalScope || window;
function maybeAdd(str) {
Expand All @@ -106,7 +115,7 @@
if (typeof obj == "string") forEach(stringProps, maybeAdd);
else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
else if (obj instanceof Function) forEach(funcProps, maybeAdd);
for (var name in obj) maybeAdd(name);
forAllProps(obj, maybeAdd)
}

if (context && context.length) {
Expand Down

0 comments on commit 5d6cfe6

Please sign in to comment.