1
0
Fork 0
forked from forgejo/forgejo

Update CodeMirror to version 5.49.0 (#8381)

* Update CodeMirror to version 5.49.0

* Update CodeMirror versions in librejs and VERSIONS
This commit is contained in:
oscar.lofwenhamn 2019-10-15 10:40:42 +02:00 committed by Lauris BH
parent 6fa14ac3c8
commit 1e9b330525
352 changed files with 14625 additions and 2451 deletions

View file

@ -6,12 +6,13 @@
<link rel="stylesheet" href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="powershell.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
</head>
<body>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>

View file

@ -1,12 +1,12 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
'use strict';
if (typeof exports == 'object' && typeof module == 'object') // CommonJS
mod(require('codemirror'));
mod(require('../../lib/codemirror'));
else if (typeof define == 'function' && define.amd) // AMD
define(['codemirror'], mod);
define(['../../lib/codemirror'], mod);
else // Plain browser env
mod(window.CodeMirror);
})(function(CodeMirror) {
@ -222,6 +222,8 @@ CodeMirror.defineMode('powershell', function() {
state.tokenize = tokenMultiString;
state.startQuote = quoteMatch[0];
return tokenMultiString(stream, state);
} else if (stream.eol()) {
return 'error';
} else if (stream.peek().match(/[({]/)) {
return 'punctuation';
} else if (stream.peek().match(varNames)) {

View file

@ -1,22 +1,24 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function() {
var mode = CodeMirror.getMode({indentUnit: 2}, "powershell");
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
function forEach(arr, f) { for (var i = 0; i < arr.length; i++) f(arr[i], i) }
MT('comment', '[number 1][comment # A]');
MT('comment_multiline', '[number 1][comment <#]',
'[comment ABC]',
'[comment #>][number 2]');
[
forEach([
'0', '1234',
'12kb', '12mb', '12Gb', '12Tb', '12PB', '12L', '12D', '12lkb', '12dtb',
'1.234', '1.234e56', '1.', '1.e2', '.2', '.2e34',
'1.2MB', '1.kb', '.1dTB', '1.e1gb', '.2', '.2e34',
'0x1', '0xabcdef', '0x3tb', '0xelmb'
].forEach(function(number) {
], function(number) {
MT("number_" + number, "[number " + number + "]");
});
@ -60,9 +62,9 @@
MT('operator_unary', "[operator +][number 3]");
MT('operator_long', "[operator -match]");
[
forEach([
'(', ')', '[[', ']]', '{', '}', ',', '`', ';', '.'
].forEach(function(punctuation) {
], function(punctuation) {
MT("punctuation_" + punctuation.replace(/^[\[\]]/,''), "[punctuation " + punctuation + "]");
});