Skip to content

Commit

Permalink
bump to CodeMirror 5.65.11
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed Dec 21, 2022
1 parent e5cc3cd commit 6c1f447
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 38 deletions.
30 changes: 15 additions & 15 deletions codemirror/js/addon/hint/sql-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }

function getModeConf(editor) {
return editor.getModeAt(editor.getCursor()).config || CodeMirror.resolveMode("text/x-sql")
function getModeConf(editor, field) {
return editor.getModeAt(editor.getCursor()).config[field] || CodeMirror.resolveMode("text/x-sql")[field]
}

function getKeywords(editor) {
return getModeConf(editor).keywords || []
return getModeConf(editor, "keywords") || []
}

function getIdentifierQuote(editor) {
return getModeConf(editor).identifierQuote || "`";
return getModeConf(editor, "identifierQuote") || "`";
}

function getText(item) {
Expand Down Expand Up @@ -109,9 +109,9 @@
var nameParts = getText(name).split(".");
for (var i = 0; i < nameParts.length; i++)
nameParts[i] = identifierQuote +
// duplicate identifierQuotes
nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) +
identifierQuote;
// duplicate identifierQuotes
nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) +
identifierQuote;
var escaped = nameParts.join(".");
if (typeof name == "string") return escaped;
name = shallowClone(name);
Expand Down Expand Up @@ -283,21 +283,21 @@
}
return w;
};
addMatches(result, search, defaultTable, function(w) {
addMatches(result, search, defaultTable, function(w) {
return objectOrClass(w, "CodeMirror-hint-table CodeMirror-hint-default-table");
});
addMatches(
});
addMatches(
result,
search,
tables, function(w) {
return objectOrClass(w, "CodeMirror-hint-table");
}
);
if (!disableKeywords)
addMatches(result, search, keywords, function(w) {
);
if (!disableKeywords)
addMatches(result, search, keywords, function(w) {
return objectOrClass(w.toUpperCase(), "CodeMirror-hint-keyword");
});
}
});
}

return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
});
Expand Down
4 changes: 2 additions & 2 deletions codemirror/js/addon/merge/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
lock.setAttribute("tabindex", "0");
var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
CodeMirror.on(lock, "keyup", function(e) { e.key === "Enter" && setScrollLock(dv, !dv.lockScroll); });
CodeMirror.on(lock, "keyup", function(e) { (e.key === "Enter" || e.code === "Space") && setScrollLock(dv, !dv.lockScroll); });
var gapElts = [lockWrap];
if (dv.mv.options.revertButtons !== false) {
dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type);
Expand All @@ -624,7 +624,7 @@
copyChunk(dv, dv.edit, dv.orig, node.chunk);
}
CodeMirror.on(dv.copyButtons, "click", copyButtons);
CodeMirror.on(dv.copyButtons, "keyup", function(e) { e.key === "Enter" && copyButtons(e); });
CodeMirror.on(dv.copyButtons, "keyup", function(e) { (e.key === "Enter" || e.code === "Space") && copyButtons(e); });
gapElts.unshift(dv.copyButtons);
}
if (dv.mv.options.connect != "align") {
Expand Down
2 changes: 1 addition & 1 deletion codemirror/js/codemirror.addon.merge.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codemirror/js/codemirror.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codemirror/js/codemirror.mode.php.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions codemirror/js/codemirror.mode.sql.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions codemirror/js/mode/clike/clike.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
name: "clike",
keywords: words("abstract as async await base break case catch checked class const continue" +
" default delegate do else enum event explicit extern finally fixed for" +
" foreach goto if implicit in interface internal is lock namespace new" +
" operator out override params private protected public readonly ref return sealed" +
" foreach goto if implicit in init interface internal is lock namespace new" +
" operator out override params private protected public readonly record ref required return sealed" +
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
" global group into join let orderby partial remove select set value var yield"),
Expand All @@ -522,7 +522,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
" UInt64 bool byte char decimal double short int long object" +
" sbyte float string ushort uint ulong"),
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
defKeywords: words("class interface namespace struct var"),
defKeywords: words("class interface namespace record struct var"),
typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
Expand Down
21 changes: 9 additions & 12 deletions codemirror/js/mode/sql/sql.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"CodeMirror"
],
"devDependencies": {
"codemirror": "^5.65.10",
"codemirror": "^5.65.11",
"grunt": "~1.5.3",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "*",
Expand Down

0 comments on commit 6c1f447

Please sign in to comment.