Skip to content

Commit

Permalink
Merge pull request #7284 from okonomiyaki3000/CodeMirrorUpdate
Browse files Browse the repository at this point in the history
CodeMirror updated to 5.5
  • Loading branch information
Kubik-Rubik committed Sep 1, 2015
2 parents a394bda + 1fccaf3 commit 796ae2a
Show file tree
Hide file tree
Showing 100 changed files with 1,946 additions and 356 deletions.
8 changes: 4 additions & 4 deletions media/editors/codemirror/addon/edit/continuelist.js
Expand Up @@ -11,8 +11,8 @@
})(function(CodeMirror) {
"use strict";

var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
unorderedListRE = /[*+-]\s/;

CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
Expand All @@ -37,10 +37,10 @@
});
replacements[i] = "\n";
} else {
var indent = match[1], after = match[4];
var indent = match[1], after = match[5];
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
? match[2]
: (parseInt(match[3], 10) + 1) + ".";
: (parseInt(match[3], 10) + 1) + match[4];

replacements[i] = "\n" + indent + bullet + after;
}
Expand Down
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/edit/continuelist.min.js

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

17 changes: 10 additions & 7 deletions media/editors/codemirror/addon/hint/show-hint.js
Expand Up @@ -99,7 +99,6 @@

update: function(first) {
if (this.tick == null) return;
if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) {
this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else {
Expand All @@ -111,6 +110,8 @@
},

finishUpdate: function(data, first) {
if (this.data) CodeMirror.signal(this.data, "update");
if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null;
this.data = data;

var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
Expand Down Expand Up @@ -351,18 +352,20 @@

CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
var to = CodeMirror.Pos(cur.line, token.end);
if (token.string && /\w/.test(token.string[token.string.length - 1])) {
var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
} else {
var term = "", from = to;
}
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, token.string.length) == token.string)
if (word.slice(0, term.length) == term)
found.push(word);
}

if (found.length) return {
list: found,
from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)
};
if (found.length) return {list: found, from: from, to: to};
});

CodeMirror.commands.autocomplete = CodeMirror.showHint;
Expand Down
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/hint/show-hint.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions media/editors/codemirror/addon/hint/sql-hint.js
Expand Up @@ -127,13 +127,13 @@

if (columns) {
addMatches(result, string, columns, function(w) {
var tableInsert = table;
if (alias == true) tableInsert = aliasTable;
if (typeof w == "string") {
var tableInsert = table;
if (alias == true) tableInsert = aliasTable;
w = tableInsert + "." + w;
} else {
w = shallowClone(w);
w.text = table + "." + w.text;
w.text = tableInsert + "." + w.text;
}
return useBacktick ? insertBackticks(w) : w;
});
Expand Down
2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/hint/sql-hint.min.js

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

2 changes: 1 addition & 1 deletion media/editors/codemirror/addon/runmode/runmode.min.js

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

0 comments on commit 796ae2a

Please sign in to comment.