Skip to content

Commit

Permalink
update plugin files
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Feb 7, 2022
1 parent d9cfa5d commit 961c265
Show file tree
Hide file tree
Showing 110 changed files with 13,492 additions and 12,241 deletions.
1,693 changes: 810 additions & 883 deletions plugins/bootstrap/js/bootstrap.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/bootstrap/js/bootstrap.bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugins/bootstrap/js/bootstrap.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/bootstrap/js/bootstrap.bundle.min.js.map

Large diffs are not rendered by default.

1,649 changes: 787 additions & 862 deletions plugins/bootstrap/js/bootstrap.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/bootstrap/js/bootstrap.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugins/bootstrap/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/bootstrap/js/bootstrap.min.js.map

Large diffs are not rendered by default.

97 changes: 54 additions & 43 deletions plugins/codemirror/addon/fold/brace-fold.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,67 @@
})(function(CodeMirror) {
"use strict";

CodeMirror.registerHelper("fold", "brace", function(cm, start) {
var line = start.line, lineText = cm.getLine(line);
var tokenType;
function bracketFolding(pairs) {
return function(cm, start) {
var line = start.line, lineText = cm.getLine(line);

function findOpening(openCh) {
for (var at = start.ch, pass = 0;;) {
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
if (found == -1) {
if (pass == 1) break;
pass = 1;
at = lineText.length;
continue;
function findOpening(pair) {
var tokenType;
for (var at = start.ch, pass = 0;;) {
var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1);
if (found == -1) {
if (pass == 1) break;
pass = 1;
at = lineText.length;
continue;
}
if (pass == 1 && found < start.ch) break;
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType, pair: pair};
at = found - 1;
}
if (pass == 1 && found < start.ch) break;
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
if (!/^(comment|string)/.test(tokenType)) return found + 1;
at = found - 1;
}
}

var startBrace = findOpening("{"), startBracket = findOpening("[")
var startToken, endToken, startCh
if (startBrace != null && (startBracket == null || startBracket > startBrace)) {
startCh = startBrace; startToken = "{"; endToken = "}"
} else if (startBracket != null) {
startCh = startBracket; startToken = "["; endToken = "]"
} else {
return
}

var count = 1, lastLine = cm.lastLine(), end, endCh;
outer: for (var i = line; i <= lastLine; ++i) {
var text = cm.getLine(i), pos = i == line ? startCh : 0;
for (;;) {
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
if (pos == text.length) break;
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
if (pos == nextOpen) ++count;
else if (!--count) { end = i; endCh = pos; break outer; }
function findRange(found) {
var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh
outer: for (var i = line; i <= lastLine; ++i) {
var text = cm.getLine(i), pos = i == line ? startCh : 0;
for (;;) {
var nextOpen = text.indexOf(found.pair[0], pos), nextClose = text.indexOf(found.pair[1], pos);
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
if (pos == text.length) break;
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) {
if (pos == nextOpen) ++count;
else if (!--count) { end = i; endCh = pos; break outer; }
}
++pos;
}
}
++pos;

if (end == null || line == end) return null
return {from: CodeMirror.Pos(line, startCh),
to: CodeMirror.Pos(end, endCh)};
}

var found = []
for (var i = 0; i < pairs.length; i++) {
var open = findOpening(pairs[i])
if (open) found.push(open)
}
found.sort(function(a, b) { return a.ch - b.ch })
for (var i = 0; i < found.length; i++) {
var range = findRange(found[i])
if (range) return range
}
return null
}
if (end == null || line == end) return;
return {from: CodeMirror.Pos(line, startCh),
to: CodeMirror.Pos(end, endCh)};
});
}

CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]]));

CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]]));

CodeMirror.registerHelper("fold", "import", function(cm, start) {
function hasImport(line) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/codemirror/addon/runmode/runmode-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
return mode.startState ? mode.startState(a1, a2) : true
}

var modeMethods = ({
var modeMethods = {
__proto__: null,
modes: modes,
mimeModes: mimeModes,
Expand All @@ -233,7 +233,7 @@
copyState: copyState,
innerMode: innerMode,
startState: startState
});
};

// declare global: globalThis, CodeMirror

Expand Down
4 changes: 2 additions & 2 deletions plugins/codemirror/addon/runmode/runmode.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function startState(mode, a1, a2) {
return mode.startState ? mode.startState(a1, a2) : true
}

var modeMethods = ({
var modeMethods = {
__proto__: null,
modes: modes,
mimeModes: mimeModes,
Expand All @@ -232,7 +232,7 @@ var modeMethods = ({
copyState: copyState,
innerMode: innerMode,
startState: startState
});
};

// Copy StringStream and mode methods into exports (CodeMirror) object.
exports.StringStream = StringStream;
Expand Down
1 change: 1 addition & 0 deletions plugins/codemirror/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
z-index: 0;
}
.CodeMirror-sizer {
position: relative;
Expand Down
8 changes: 5 additions & 3 deletions plugins/codemirror/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -2585,9 +2585,11 @@
}

function widgetTopHeight(lineObj) {
var ref = visualLine(lineObj);
var widgets = ref.widgets;
var height = 0;
if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)
{ height += widgetHeight(lineObj.widgets[i]); } } }
if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)
{ height += widgetHeight(widgets[i]); } } }
return height
}

Expand Down Expand Up @@ -9840,7 +9842,7 @@

addLegacyProps(CodeMirror);

CodeMirror.version = "5.64.0";
CodeMirror.version = "5.65.1";

return CodeMirror;

Expand Down
16 changes: 16 additions & 0 deletions plugins/codemirror/keymap/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
{ keys: '<Right>', type: 'keyToKey', toKeys: 'l' },
{ keys: '<Up>', type: 'keyToKey', toKeys: 'k' },
{ keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
{ keys: 'g<Up>', type: 'keyToKey', toKeys: 'gk' },
{ keys: 'g<Down>', type: 'keyToKey', toKeys: 'gj' },
{ keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
{ keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},
{ keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal'},
Expand All @@ -94,6 +96,7 @@
{ keys: '<PageUp>', type: 'keyToKey', toKeys: '<C-b>' },
{ keys: '<PageDown>', type: 'keyToKey', toKeys: '<C-f>' },
{ keys: '<CR>', type: 'keyToKey', toKeys: 'j^', context: 'normal' },
{ keys: '<Ins>', type: 'keyToKey', toKeys: 'i', context: 'normal'},
{ keys: '<Ins>', type: 'action', action: 'toggleOverwrite', context: 'insert' },
// Motions
{ keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }},
Expand Down Expand Up @@ -123,6 +126,9 @@
{ keys: '<C-u>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }},
{ keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
{ keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
{keys: "g$", type: "motion", motion: "moveToEndOfDisplayLine"},
{keys: "g^", type: "motion", motion: "moveToStartOfDisplayLine"},
{keys: "g0", type: "motion", motion: "moveToStartOfDisplayLine"},
{ keys: '0', type: 'motion', motion: 'moveToStartOfLine' },
{ keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }},
Expand Down Expand Up @@ -2086,6 +2092,16 @@
return new Pos(lineNum,
findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
},
moveToStartOfDisplayLine: function(cm) {
cm.execCommand("goLineLeft");
return cm.getCursor();
},
moveToEndOfDisplayLine: function(cm) {
cm.execCommand("goLineRight");
var head = cm.getCursor();
if (head.sticky == "before") head.ch--;
return head;
},
textObjectManipulation: function(cm, head, motionArgs, vim) {
// TODO: lots of possible exceptions that can be thrown here. Try da(
// outside of a () block.
Expand Down
1 change: 1 addition & 0 deletions plugins/codemirror/mode/commonlisp/commonlisp.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ CodeMirror.defineMode("commonlisp", function (config) {

closeBrackets: {pairs: "()[]{}\"\""},
lineComment: ";;",
fold: "brace-paren",
blockCommentStart: "#|",
blockCommentEnd: "|#"
};
Expand Down
6 changes: 3 additions & 3 deletions plugins/codemirror/mode/css/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
"compact", "condensed", "contain", "content", "contents",
"compact", "condensed", "conic-gradient", "contain", "content", "contents",
"content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
"cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
Expand Down Expand Up @@ -687,8 +687,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
"progress", "push-button", "radial-gradient", "radio", "read-only",
"read-write", "read-write-plaintext-only", "rectangle", "region",
"relative", "repeat", "repeating-linear-gradient",
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient",
"repeating-conic-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
"s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
Expand Down
2 changes: 1 addition & 1 deletion plugins/codemirror/mode/factor/factor.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
// specific to simple modes.
meta: {
dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
lineComment: [ "!", "#!" ]
lineComment: "!"
}
});

Expand Down
2 changes: 1 addition & 1 deletion plugins/codemirror/mode/fortran/fortran.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ CodeMirror.defineMode("fortran", function() {
"c_short", "c_signed_char", "c_size_t", "character",
"complex", "double", "integer", "logical", "real"]);
var isOperatorChar = /[+\-*&=<>\/\:]/;
var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i");
var litOperator = /^\.(and|or|eq|lt|le|gt|ge|ne|not|eqv|neqv)\./i;

function tokenBase(stream, state) {

Expand Down
1 change: 1 addition & 0 deletions plugins/codemirror/mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
cx.state.localVars = null
}
pushcontext.lex = pushblockcontext.lex = true
function popcontext() {
cx.state.localVars = cx.state.context.vars
cx.state.context = cx.state.context.prev
Expand Down
2 changes: 1 addition & 1 deletion plugins/codemirror/mode/mllike/mllike.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
}
}
if (ch === '(') {
if (stream.eat('*')) {
if (stream.match(/^\*(?!\))/)) {
state.commentLevel++;
state.tokenize = tokenComment;
return state.tokenize(stream, state);
Expand Down
Loading

0 comments on commit 961c265

Please sign in to comment.