From 51257fc619abb78487c07be9f713eaa3ab816d79 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Wed, 24 Feb 2021 12:08:09 +0000 Subject: [PATCH] Update CodeMirror to 5.59.4 This pulls in the fix for https://github.com/codemirror/CodeMirror/issues/6599 It also fixes an issue with the darkmode sheet generation that had the wrong path for Chrome binaries on Mac. R=jacktfranklin@chromium.org Bug: 1180740 Change-Id: I8b879bdefb0567c4d44b457255c88ef4395924c9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2716287 Commit-Queue: Tim van der Lippe Commit-Queue: Jack Franklin Auto-Submit: Tim van der Lippe Reviewed-by: Jack Franklin --- front_end/text_editor/cmdevtools.css | 4 +- front_end/text_editor/cmdevtools.darkmode.css | 4 +- .../third_party/codemirror/README.chromium | 4 +- .../third_party/codemirror/package/AUTHORS | 3 + .../codemirror/package/CHANGELOG.md | 42 ++++- .../package/addon/edit/closebrackets.js | 2 +- .../package/addon/edit/continuelist.js | 2 +- .../package/addon/edit/matchbrackets.js | 12 +- .../package/addon/fold/brace-fold.js | 13 +- .../package/addon/hint/javascript-hint.js | 2 +- .../package/addon/hint/show-hint.js | 16 +- .../codemirror/package/addon/hint/sql-hint.js | 4 +- .../package/addon/search/match-highlighter.js | 2 +- .../codemirror/package/keymap/emacs.js | 12 +- .../codemirror/package/keymap/vim.js | 145 +++++++++++------- .../codemirror/package/lib/codemirror.css | 2 +- .../codemirror/package/lib/codemirror.js | 18 +-- .../codemirror/package/mode/asn.1/asn.1.js | 2 +- .../codemirror/package/mode/clike/clike.js | 10 +- .../codemirror/package/mode/css/css.js | 8 +- .../codemirror/package/mode/cypher/cypher.js | 4 +- .../codemirror/package/mode/dtd/dtd.js | 4 +- .../codemirror/package/mode/ebnf/ebnf.js | 14 +- .../codemirror/package/mode/factor/factor.js | 2 +- .../codemirror/package/mode/gas/gas.js | 4 +- .../codemirror/package/mode/haml/haml.js | 2 +- .../codemirror/package/mode/idl/idl.js | 2 +- .../package/mode/javascript/javascript.js | 2 +- .../codemirror/package/mode/julia/julia.js | 22 +-- .../package/mode/markdown/markdown.js | 8 +- .../codemirror/package/mode/meta.js | 2 +- .../package/mode/modelica/modelica.js | 6 +- .../codemirror/package/mode/mscgen/mscgen.js | 8 +- .../codemirror/package/mode/mumps/mumps.js | 2 +- .../codemirror/package/mode/oz/oz.js | 4 +- .../codemirror/package/mode/pegjs/pegjs.js | 6 +- .../codemirror/package/mode/perl/perl.js | 4 +- .../codemirror/package/mode/php/php.js | 4 +- .../codemirror/package/mode/pug/pug.js | 2 +- .../codemirror/package/mode/puppet/puppet.js | 2 +- .../codemirror/package/mode/rpm/rpm.js | 8 +- .../codemirror/package/mode/sass/sass.js | 2 +- .../codemirror/package/mode/scheme/scheme.js | 2 +- .../codemirror/package/mode/sieve/sieve.js | 2 +- .../codemirror/package/mode/soy/soy.js | 10 +- .../codemirror/package/mode/sql/sql.js | 10 +- .../codemirror/package/mode/stylus/stylus.js | 2 +- .../package/mode/tiddlywiki/tiddlywiki.js | 2 +- .../package/mode/vbscript/vbscript.js | 4 +- .../package/mode/velocity/velocity.js | 2 +- .../package/mode/verilog/verilog.js | 4 +- .../codemirror/package/mode/wast/wast.js | 4 +- .../mode/yaml-frontmatter/yaml-frontmatter.js | 2 +- .../codemirror/package/mode/yaml/yaml.js | 8 +- .../codemirror/package/package.json | 2 +- .../codemirror/package/src/edit/main.js | 2 +- .../codemirror/package/src/edit/methods.js | 2 +- .../codemirror/package/src/edit/options.js | 2 +- .../codemirror/package/src/model/Doc.js | 4 +- .../codemirror/package/src/model/history.js | 6 +- .../package/src/model/selection_updates.js | 2 +- scripts/devtools_paths.js | 2 +- 62 files changed, 292 insertions(+), 203 deletions(-) diff --git a/front_end/text_editor/cmdevtools.css b/front_end/text_editor/cmdevtools.css index b42d403eeb..1a6a57ea5e 100644 --- a/front_end/text_editor/cmdevtools.css +++ b/front_end/text_editor/cmdevtools.css @@ -730,7 +730,9 @@ div.CodeMirror:focus-within span.CodeMirror-nonmatchingbracket { .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: var(--color-background); /* The little square between H and V scrollbars */ + /* The little square between H and V scrollbars */ + background-color: white; /* stylelint-disable-line color-named */ + /* See: crbug.com/1152736 for color variable migration. */ } /* Shown when moving in bi-directional text */ diff --git a/front_end/text_editor/cmdevtools.darkmode.css b/front_end/text_editor/cmdevtools.darkmode.css index 147d0f91b7..ec3febab76 100644 --- a/front_end/text_editor/cmdevtools.darkmode.css +++ b/front_end/text_editor/cmdevtools.darkmode.css @@ -1,6 +1,6 @@ /* This file was automatically generated via: npm run generate-dark-mode-styles front_end/text_editor/cmdevtools.css -* Last Updated: Tue Feb 23 2021 12:16:31 GMT+0000 (Greenwich Mean Time) +* Last Updated: Wed Feb 24 2021 12:07:36 GMT+0000 (Greenwich Mean Time) */ /* stylelint-disable */ :host-context(.-theme-with-dark-background) .CodeMirror, .-theme-with-dark-background .CodeMirror{ @@ -100,7 +100,7 @@ color:rgb(127 127 127);} :host-context(.-theme-with-dark-background) .CodeMirror .placeholder-text, .-theme-with-dark-background .CodeMirror .placeholder-text{ color:rgb(127 127 127);} :host-context(.-theme-with-dark-background) .CodeMirror-scrollbar-filler, .-theme-with-dark-background .CodeMirror-scrollbar-filler, :host-context(.-theme-with-dark-background) .CodeMirror-gutter-filler, .-theme-with-dark-background .CodeMirror-gutter-filler{ -background-color:var(--color-background);} +background-color:rgb(36 36 36);} :host-context(.-theme-with-dark-background) .CodeMirror div.CodeMirror-secondarycursor, .-theme-with-dark-background .CodeMirror div.CodeMirror-secondarycursor{ border-left-color:rgb(67 67 67);} :host-context(.-theme-with-dark-background) .CodeMirror-foldmarker::before, .-theme-with-dark-background .CodeMirror-foldmarker::before{ diff --git a/front_end/third_party/codemirror/README.chromium b/front_end/third_party/codemirror/README.chromium index 63e2495d12..6500735595 100644 --- a/front_end/third_party/codemirror/README.chromium +++ b/front_end/third_party/codemirror/README.chromium @@ -1,7 +1,7 @@ Name: CodeMirror is a versatile text editor implemented in JavaScript for the browser. Short Name: CodeMirror URL: https://github.com/codemirror/CodeMirror/ -Version: 5.59.1 +Version: 5.59.4 License: MIT License File: LICENSE Security Critical: no @@ -14,7 +14,7 @@ Every language comes with fully-featured code and syntax highlighting to help wi To update this package, run the following command (replace version number with updated version number): ```bash -wget -qO- https://registry.npmjs.org/codemirror/-/codemirror-5.59.1.tgz | tar xzf - +wget -qO- https://registry.npmjs.org/codemirror/-/codemirror-5.59.4.tgz | tar xzf - ``` Local changes applied: diff --git a/front_end/third_party/codemirror/package/AUTHORS b/front_end/third_party/codemirror/package/AUTHORS index 4ea87576d3..bba9e1fade 100644 --- a/front_end/third_party/codemirror/package/AUTHORS +++ b/front_end/third_party/codemirror/package/AUTHORS @@ -36,6 +36,7 @@ Alexandre Bique Alex Churchill alexey-k Alex Piggott +Alf Eaton Aliaksei Chapyzhenka Allen Sarkisyan Ami Fischman @@ -510,6 +511,7 @@ Lucas Buchala Luciano Longo Luciano Santana Lu Fangjian +Ɓukasz Wielgus Luke Browning Luke Granger-Brown Luke Stagner @@ -832,6 +834,7 @@ Thaddee Tyl thanasis TheHowl themrmax +Thiemo Kreuz think Thomas Brouard Thomas Dvornik diff --git a/front_end/third_party/codemirror/package/CHANGELOG.md b/front_end/third_party/codemirror/package/CHANGELOG.md index 5a9baf4df1..c1c26f300c 100644 --- a/front_end/third_party/codemirror/package/CHANGELOG.md +++ b/front_end/third_party/codemirror/package/CHANGELOG.md @@ -1,3 +1,31 @@ +## 5.59.4 (2021-02-24) + +### Bug fixes + +Give the scrollbar corner filler a background again, to prevent content from peeping through between the scrollbars. + +## 5.59.3 (2021-02-20) + +### Bug fixes + +Don't override the way zero-with non-joiners are rendered. + +Fix an issue where resetting the history cleared the `undoDepth` option's value. + +[vim bindings](https://codemirror.net/demo/vim.html): Fix substitute command when joining and splitting lines, fix global command when line number change, add support for `:vglobal`, properly treat caps lock as a modifier key. + +## 5.59.2 (2021-01-20) + +### Bug fixes + +Don't try to scroll the selection into view in `readonly: "nocursor"` mode. + +[closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets): Fix a regression in the behavior of pressing enter between brackets. + +[javascript mode](https://codemirror.net/mode/javascript/): Fix an infinite loop on specific syntax errors in object types. + +various modes: Fix inefficient RegExp matching. + ## 5.59.1 (2020-12-31) ### Bug fixes @@ -234,7 +262,7 @@ Make Shift-Delete to cut work on Firefox. [handlebars mode](https://codemirror.net/mode/handlebars/): Fix triple-brace support. -[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support mathing `$` in reverse regexp search. +[searchcursor addon](https://codemirror.net/doc/manual.html#addon_searchcursor): Support matching `$` in reverse regexp search. [panel addon](https://codemirror.net/doc/manual.html#addon_panel): Don't get confused by changing panel sizes. @@ -490,7 +518,7 @@ Add `hintWords` (basic completion) helper to [clojure](https://codemirror.net/mo [panel addon](https://codemirror.net/doc/manual.html#addon_panel): Fix problem where replacing the last remaining panel dropped the newly added panel. -[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Fix an infinite loop when the indention is greater than the target column. +[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Fix an infinite loop when the indentation is greater than the target column. [jinja2](https://codemirror.net/mode/jinja2/) and [markdown](https://codemirror.net/mode/markdown/) modes: Add comment metadata. @@ -878,7 +906,7 @@ Add `role=presentation` to more DOM elements to improve screen reader support. [merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make aligning of unchanged chunks more robust. -[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (differnet) block comment. +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (different) block comment. [javascript mode](https://codemirror.net/mode/javascript/): Improve support for TypeScript syntax. @@ -996,7 +1024,7 @@ New event: [`optionChange`](https://codemirror.net/doc/manual.html#event_optionC Tapping/clicking the editor in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle) on Chrome now puts the cursor at the tapped position. -Fix various crashes and misbehaviors when reading composition events in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle). +Fix various crashes and misbehavior when reading composition events in [contentEditable mode](https://codemirror.net/doc/manual.html#option_inputStyle). Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a ``. @@ -1331,7 +1359,7 @@ Fix a [bug](https://github.com/codemirror/CodeMirror/issues/3834) that caused ph * New modes: [Vue](https://codemirror.net/mode/vue/index.html), [Oz](https://codemirror.net/mode/oz/index.html), [MscGen](https://codemirror.net/mode/mscgen/index.html) (and dialects), [Closure Stylesheets](https://codemirror.net/mode/css/gss.html) * Implement [CommonMark](http://commonmark.org)-style flexible list indent and cross-line code spans in [Markdown](https://codemirror.net/mode/markdown/index.html) mode * Add a replace-all button to the [search addon](https://codemirror.net/doc/manual.html#addon_search), and make the persistent search dialog transparent when it obscures the match -* Handle `acync`/`await` and ocal and binary numbers in [JavaScript mode](https://codemirror.net/mode/javascript/index.html) +* Handle `async`/`await` and ocal and binary numbers in [JavaScript mode](https://codemirror.net/mode/javascript/index.html) * Fix various issues with the [Haxe mode](https://codemirror.net/mode/haxe/index.html) * Make the [closebrackets addon](https://codemirror.net/doc/manual.html#addon_closebrackets) select only the wrapped text when wrapping selection in brackets * Tokenize properties as properties in the [CoffeeScript mode](https://codemirror.net/mode/coffeescript/index.html) @@ -1818,7 +1846,7 @@ Emergency fix for a bug where an editor with line wrapping on IE will break when * Slightly incompatible API changes. Read [this](https://codemirror.net/doc/upgrade_v2.2.html). * New approach to [binding](https://codemirror.net/doc/manual.html#option_extraKeys) keys, support for [custom bindings](https://codemirror.net/doc/manual.html#option_keyMap). * Support for overwrite (insert). -* [Custom-width](https://codemirror.net/doc/manual.html#option_tabSize) and [stylable](https://codemirror.net/demo/visibletabs.html) tabs. +* [Custom-width](https://codemirror.net/doc/manual.html#option_tabSize) and [styleable](https://codemirror.net/demo/visibletabs.html) tabs. * Moved more code into [add-on scripts](https://codemirror.net/doc/manual.html#addons). * Support for sane vertical cursor movement in wrapped lines. * More reliable handling of editing [marked text](https://codemirror.net/doc/manual.html#markText). @@ -1832,7 +1860,7 @@ Fixes `TextMarker.clear`, which is broken in 2.17. ## 2.17.0 (2011-11-21) * Add support for [line wrapping](https://codemirror.net/doc/manual.html#option_lineWrapping) and [code folding](https://codemirror.net/doc/manual.html#hideLine). -* Add [Github-style Markdown](https://codemirror.net/mode/gfm/index.html) mode. +* Add [GitHub-style Markdown](https://codemirror.net/mode/gfm/index.html) mode. * Add [Monokai](https://codemirror.net/theme/monokai.css) and [Rubyblue](https://codemirror.net/theme/rubyblue.css) themes. * Add [`setBookmark`](https://codemirror.net/doc/manual.html#setBookmark) method. * Move some of the demo code into reusable components under [`lib/util`](https://codemirror.net/addon/). diff --git a/front_end/third_party/codemirror/package/addon/edit/closebrackets.js b/front_end/third_party/codemirror/package/addon/edit/closebrackets.js index 5c1aeab3c5..593d4439fb 100644 --- a/front_end/third_party/codemirror/package/addon/edit/closebrackets.js +++ b/front_end/third_party/codemirror/package/addon/edit/closebrackets.js @@ -102,7 +102,7 @@ for (var i = 0; i < ranges.length; i++) { var range = ranges[i] if (range.head == cm.getCursor()) primary = i - var pos = {line: range.head.line, ch: range.head.ch + dir} + var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1} newRanges.push({anchor: pos, head: pos}) } cm.setSelections(newRanges, primary) diff --git a/front_end/third_party/codemirror/package/addon/edit/continuelist.js b/front_end/third_party/codemirror/package/addon/edit/continuelist.js index 2e5625adc4..6ec65010d2 100644 --- a/front_end/third_party/codemirror/package/addon/edit/continuelist.js +++ b/front_end/third_party/codemirror/package/addon/edit/continuelist.js @@ -90,7 +90,7 @@ }); } else { if (startIndent.length > nextIndent.length) return; - // This doesn't run if the next line immediatley indents, as it is + // This doesn't run if the next line immediately indents, as it is // not clear of the users intention (new indented item or same level) if ((startIndent.length < nextIndent.length) && (lookAhead === 1)) return; skipCount += 1; diff --git a/front_end/third_party/codemirror/package/addon/edit/matchbrackets.js b/front_end/third_party/codemirror/package/addon/edit/matchbrackets.js index 0377408802..43dc8840f5 100644 --- a/front_end/third_party/codemirror/package/addon/edit/matchbrackets.js +++ b/front_end/third_party/codemirror/package/addon/edit/matchbrackets.js @@ -38,7 +38,7 @@ if (config && config.strict && (dir > 0) != (pos == where.ch)) return null; var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config); if (found == null) return null; return {from: Pos(where.line, pos), to: found && found.pos, match: found && found.ch == match.charAt(0), forward: dir > 0}; @@ -67,7 +67,8 @@ if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); for (; pos != end; pos += dir) { var ch = line.charAt(pos); - if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { + if (re.test(ch) && (style === undefined || + (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) { var match = matching[ch]; if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch); else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; @@ -80,11 +81,12 @@ function matchBrackets(cm, autoclear, config) { // Disable brace matching in long lines, since it'll cause hugely slow updates - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; + var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000, + highlightNonMatching = config && config.highlightNonMatching; var marks = [], ranges = cm.listSelections(); for (var i = 0; i < ranges.length; i++) { var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); - if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { + if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) { var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) @@ -94,7 +96,7 @@ if (marks.length) { // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. + // input stops going to the textarea whenever this fires. if (ie_lt8 && cm.state.focused) cm.focus(); var clear = function() { diff --git a/front_end/third_party/codemirror/package/addon/fold/brace-fold.js b/front_end/third_party/codemirror/package/addon/fold/brace-fold.js index 654d1fb691..79a331cf68 100644 --- a/front_end/third_party/codemirror/package/addon/fold/brace-fold.js +++ b/front_end/third_party/codemirror/package/addon/fold/brace-fold.js @@ -31,13 +31,16 @@ CodeMirror.registerHelper("fold", "brace", function(cm, start) { } } - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); + 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 } - if (startCh == null) 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; diff --git a/front_end/third_party/codemirror/package/addon/hint/javascript-hint.js b/front_end/third_party/codemirror/package/addon/hint/javascript-hint.js index 6d09e6b44e..9f06b1b546 100644 --- a/front_end/third_party/codemirror/package/addon/hint/javascript-hint.js +++ b/front_end/third_party/codemirror/package/addon/hint/javascript-hint.js @@ -69,7 +69,7 @@ function getCoffeeScriptToken(editor, cur) { // This getToken, it is for coffeescript, imitates the behavior of // getTokenAt method in javascript.js, that is, returning "property" - // type and treat "." as indepenent token. + // type and treat "." as independent token. var token = editor.getTokenAt(cur); if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { token.end = token.start; diff --git a/front_end/third_party/codemirror/package/addon/hint/show-hint.js b/front_end/third_party/codemirror/package/addon/hint/show-hint.js index 5ef1bba645..a9f2ded18c 100644 --- a/front_end/third_party/codemirror/package/addon/hint/show-hint.js +++ b/front_end/third_party/codemirror/package/addon/hint/show-hint.js @@ -61,8 +61,10 @@ this.startPos = this.cm.getCursor("start"); this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; - var self = this; - cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + if (this.options.updateOnCursorActivity) { + var self = this; + cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + } } var requestAnimationFrame = window.requestAnimationFrame || function(fn) { @@ -75,7 +77,9 @@ if (!this.active()) return; this.cm.state.completionActive = null; this.tick = null; - this.cm.off("cursorActivity", this.activityFunc); + if (this.options.updateOnCursorActivity) { + this.cm.off("cursorActivity", this.activityFunc); + } if (this.widget && this.data) CodeMirror.signal(this.data, "close"); if (this.widget) this.widget.close(); @@ -117,9 +121,7 @@ if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || pos.ch < identStart.ch || this.cm.somethingSelected() || (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { - if (this.options.closeOnCursorActivity) { - this.close(); - } + this.close(); } else { var self = this; this.debounce = requestAnimationFrame(function() {self.update();}); @@ -492,9 +494,9 @@ completeSingle: true, alignWithWord: true, closeCharacters: /[\s()\[\]{};:>,]/, - closeOnCursorActivity: true, closeOnPick: true, closeOnUnfocus: true, + updateOnCursorActivity: true, completeOnSingleClick: true, container: null, customKeys: null, diff --git a/front_end/third_party/codemirror/package/addon/hint/sql-hint.js b/front_end/third_party/codemirror/package/addon/hint/sql-hint.js index 5b65e29105..efdce813cf 100644 --- a/front_end/third_party/codemirror/package/addon/hint/sql-hint.js +++ b/front_end/third_party/codemirror/package/addon/hint/sql-hint.js @@ -97,7 +97,7 @@ if (name.charAt(0) == ".") { name = name.substr(1); } - // replace doublicated identifierQuotes with single identifierQuotes + // replace duplicated identifierQuotes with single identifierQuotes // and remove single identifierQuotes var nameParts = name.split(identifierQuote+identifierQuote); for (var i = 0; i < nameParts.length; i++) @@ -109,7 +109,7 @@ var nameParts = getText(name).split("."); for (var i = 0; i < nameParts.length; i++) nameParts[i] = identifierQuote + - // doublicate identifierQuotes + // duplicate identifierQuotes nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) + identifierQuote; var escaped = nameParts.join("."); diff --git a/front_end/third_party/codemirror/package/addon/search/match-highlighter.js b/front_end/third_party/codemirror/package/addon/search/match-highlighter.js index 3a4a7dedc1..9b181ebc01 100644 --- a/front_end/third_party/codemirror/package/addon/search/match-highlighter.js +++ b/front_end/third_party/codemirror/package/addon/search/match-highlighter.js @@ -16,7 +16,7 @@ // highlighted only if the selected text is a word. showToken, when enabled, // will cause the current token to be highlighted when nothing is selected. // delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. If annotateScrollbar is enabled, the occurences +// highlighting the matches. If annotateScrollbar is enabled, the occurrences // will be highlighted on the scrollbar via the matchesonscrollbar addon. (function(mod) { diff --git a/front_end/third_party/codemirror/package/keymap/emacs.js b/front_end/third_party/codemirror/package/keymap/emacs.js index fe4882eb44..91d8abbbc4 100644 --- a/front_end/third_party/codemirror/package/keymap/emacs.js +++ b/front_end/third_party/codemirror/package/keymap/emacs.js @@ -233,9 +233,19 @@ cm.setCursor(cm.getCursor()); } + function makePrompt(msg) { + var fragment = document.createDocumentFragment(); + var input = document.createElement("input"); + input.setAttribute("type", "text"); + input.style.width = "10em"; + fragment.appendChild(document.createTextNode(msg + ": ")); + fragment.appendChild(input); + return fragment; + } + function getInput(cm, msg, f) { if (cm.openDialog) - cm.openDialog(msg + ": ", f, {bottom: true}); + cm.openDialog(makePrompt(msg), f, {bottom: true}); else f(prompt(msg, "")); } diff --git a/front_end/third_party/codemirror/package/keymap/vim.js b/front_end/third_party/codemirror/package/keymap/vim.js index 789e1e55b3..6630b6f61a 100644 --- a/front_end/third_party/codemirror/package/keymap/vim.js +++ b/front_end/third_party/codemirror/package/keymap/vim.js @@ -244,6 +244,7 @@ { name: 'yank', shortName: 'y' }, { name: 'delmarks', shortName: 'delm' }, { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, + { name: 'vglobal', shortName: 'v' }, { name: 'global', shortName: 'g' } ]; @@ -353,7 +354,7 @@ return cmd; } - var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; + var modifiers = {Shift:'S',Ctrl:'C',Alt:'A',Cmd:'D',Mod:'A',CapsLock:''}; var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del',Insert:'Ins'}; function cmKeyToVimKey(key) { if (key.charAt(0) == '\'') { @@ -737,7 +738,7 @@ // TODO: Convert keymap into dictionary format for fast lookup. }, // Testing hook, though it might be useful to expose the register - // controller anyways. + // controller anyway. getRegisterController: function() { return vimGlobalState.registerController; }, @@ -1450,7 +1451,7 @@ showPrompt(cm, { onClose: onPromptClose, prefix: promptPrefix, - desc: searchPromptDesc, + desc: '(JavaScript regexp)', onKeyUp: onPromptKeyUp, onKeyDown: onPromptKeyDown }); @@ -3483,7 +3484,7 @@ }, isComplete: function(state) { if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; + var token = state.lineText.match(/^#(\w+)/)[1]; if (token === 'endif') { if (state.forward && state.depth === 0) { return true; @@ -4110,16 +4111,6 @@ var vim = cm.state.vim; return vim.searchState_ || (vim.searchState_ = new SearchState()); } - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, - onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, - selectValueOnOpen: false}); - } - else { - onClose(prompt(shortText, '')); - } - } function splitBySlash(argString) { return splitBySeparator(argString, '/'); } @@ -4306,28 +4297,64 @@ (ignoreCase || forceIgnoreCase) ? 'i' : undefined); return regexp; } - function showConfirm(cm, text) { + + /** + * dom - Document Object Manipulator + * Usage: + * dom(''|[, ...{|<$styles>}||'']) + * Examples: + * dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) + * dom(document.head, dom('script', 'alert("hello!")')) + * Not supported: + * dom('p', ['arrays are objects'], Error('objects specify attributes')) + */ + function dom(n) { + if (typeof n === 'string') n = document.createElement(n); + for (var a, i = 1; i < arguments.length; i++) { + if (!(a = arguments[i])) continue; + if (typeof a !== 'object') a = document.createTextNode(a); + if (a.nodeType) n.appendChild(a); + else for (var key in a) { + if (!Object.prototype.hasOwnProperty.call(a, key)) continue; + if (key[0] === '$') n.style[key.slice(1)] = a[key]; + else n.setAttribute(key, a[key]); + } + } + return n; + } + + function showConfirm(cm, template) { + var pre = dom('pre', {$color: 'red'}, template); if (cm.openNotification) { - cm.openNotification('' + text + '', - {bottom: true, duration: 5000}); + cm.openNotification(pre, {bottom: true, duration: 5000}); } else { - alert(text); + alert(pre.innerText); } } + function makePrompt(prefix, desc) { - var raw = '' + - (prefix || "") + ''; - if (desc) - raw += ' ' + desc + ''; - return raw; + return dom(document.createDocumentFragment(), + dom('span', {$fontFamily: 'monospace', $whiteSpace: 'pre'}, + prefix, + dom('input', {type: 'text', autocorrect: 'off', + autocapitalize: 'off', spellcheck: 'false'})), + desc && dom('span', {$color: '#888'}, desc)); } - var searchPromptDesc = '(Javascript regexp)'; + function showPrompt(cm, options) { var shortText = (options.prefix || '') + ' ' + (options.desc || ''); - var prompt = makePrompt(options.prefix, options.desc); - dialog(cm, prompt, shortText, options.onClose, options); + var template = makePrompt(options.prefix, options.desc); + if (cm.openDialog) { + cm.openDialog(template, options.onClose, { + onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, + bottom: true, selectValueOnOpen: false, value: options.value + }); + } + else { + options.onClose(prompt(shortText, '')); + } } + function regexEqual(r1, r2) { if (r1 instanceof RegExp && r2 instanceof RegExp) { var props = ['global', 'multiline', 'ignoreCase', 'source']; @@ -4501,7 +4528,7 @@ if (start instanceof Array) { return inArray(pos, start); } else { - if (end) { + if (typeof end == 'number') { return (pos >= start && pos <= end); } else { return pos == start; @@ -4564,7 +4591,7 @@ try { this.parseInput_(cm, inputStream, params); } catch(e) { - showConfirm(cm, e); + showConfirm(cm, e.toString()); throw e; } var command; @@ -4608,7 +4635,7 @@ params.callback(); } } catch(e) { - showConfirm(cm, e); + showConfirm(cm, e.toString()); throw e; } }, @@ -4880,12 +4907,12 @@ registers: function(cm, params) { var regArgs = params.args; var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

'; + var regInfo = '----------Registers----------\n\n'; if (!regArgs) { for (var registerName in registers) { var text = registers[registerName].toString(); if (text.length) { - regInfo += '"' + registerName + ' ' + text + '
'; + regInfo += '"' + registerName + ' ' + text + '\n' } } } else { @@ -4897,7 +4924,7 @@ continue; } var register = registers[registerName] || new Register(); - regInfo += '"' + registerName + ' ' + register.toString() + '
'; + regInfo += '"' + registerName + ' ' + register.toString() + '\n' } } showConfirm(cm, regInfo); @@ -4992,6 +5019,10 @@ } cm.replaceRange(text.join('\n'), curStart, curEnd); }, + vglobal: function(cm, params) { + // global inspects params.commandName + this.global(cm, params); + }, global: function(cm, params) { // a global command is of the form // :[range]g/pattern/[cmd] @@ -5001,6 +5032,7 @@ showConfirm(cm, 'Regular Expression missing from global'); return; } + var inverted = params.commandName[0] === 'v'; // range is specified here var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); var lineEnd = params.lineEnd || params.line || cm.lastLine(); @@ -5025,28 +5057,33 @@ // now that we have the regexPart, search for regex matches in the // specified range of lines var query = getSearchState(cm).getQuery(); - var matchedLines = [], content = ''; + var matchedLines = []; for (var i = lineStart; i <= lineEnd; i++) { - var matched = query.test(cm.getLine(i)); - if (matched) { - matchedLines.push(i+1); - content+= cm.getLine(i) + '
'; + var line = cm.getLineHandle(i); + var matched = query.test(line.text); + if (matched !== inverted) { + matchedLines.push(cmd ? line : line.text); } } // if there is no [cmd], just display the list of matched lines if (!cmd) { - showConfirm(cm, content); + showConfirm(cm, matchedLines.join('\n')); return; } var index = 0; var nextCommand = function() { if (index < matchedLines.length) { - var command = matchedLines[index] + cmd; + var line = matchedLines[index++]; + var lineNum = cm.getLineNumber(line); + if (lineNum == null) { + nextCommand(); + return; + } + var command = (lineNum + 1) + cmd; exCommandDispatcher.processCommand(cm, command, { callback: nextCommand }); } - index++; }; nextCommand(); }, @@ -5066,9 +5103,11 @@ regexPart = new RegExp(regexPart).source; //normalize not escaped characters } replacePart = tokens[1]; - if (regexPart && regexPart[regexPart.length - 1] === '$') { - regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n'; - replacePart = replacePart ? replacePart + '\n' : '\n'; + // If the pattern ends with $ (line boundary assertion), change $ to \n. + // Caveat: this workaround cannot match on the last line of the document. + if (/(^|[^\\])(\\\\)*\$$/.test(regexPart)) { + regexPart = regexPart.slice(0, -1) + '\\n'; + replacePart = (replacePart || '') + '\n'; } if (replacePart !== undefined) { if (getOption('pcre')) { @@ -5097,11 +5136,9 @@ if (flagsPart) { if (flagsPart.indexOf('c') != -1) { confirm = true; - flagsPart.replace('c', ''); } if (flagsPart.indexOf('g') != -1) { global = true; - flagsPart.replace('g', ''); } if (getOption('pcre')) { regexPart = regexPart + '/' + flagsPart; @@ -5234,7 +5271,7 @@ * @param {Cursor} lineEnd Line to stop replacing at. * @param {RegExp} query Query for performing matches with. * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. + * $2, etc for replacing captured groups using JavaScript replace. * @param {function()} callback A callback for when the replace is done. */ function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, @@ -5242,7 +5279,7 @@ // Set up all the functions. cm.state.vim.exMode = true; var done = false; - var lastPos = searchCursor.from(); + var lastPos, modifiedLineNumber, joined; function replaceAll() { cm.operation(function() { while (!done) { @@ -5255,14 +5292,18 @@ function replace() { var text = cm.getRange(searchCursor.from(), searchCursor.to()); var newText = text.replace(query, replaceWith); + var unmodifiedLineNumber = searchCursor.to().line; searchCursor.replace(newText); + modifiedLineNumber = searchCursor.to().line; + lineEnd += modifiedLineNumber - unmodifiedLineNumber; + joined = modifiedLineNumber < unmodifiedLineNumber; } function next() { // The below only loops to skip over multiple occurrences on the same // line when 'global' is not true. while(searchCursor.findNext() && isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { + if (!global && searchCursor.from().line == modifiedLineNumber && !joined) { continue; } cm.scrollIntoView(searchCursor.from(), 30); @@ -5327,7 +5368,7 @@ return; } showPrompt(cm, { - prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', + prefix: dom('span', 'replace with ', dom('strong', replaceWith), ' (y/n/a/q/l)'), onKeyDown: onPromptKeyDown }); } @@ -5535,9 +5576,7 @@ clearFakeCursor(vim); // In visual mode, the cursor may be positioned over EOL. if (from.ch == cm.getLine(from.line).length) { - var widget = document.createElement("span"); - widget.textContent = "\u00a0"; - widget.className = className; + var widget = dom('span', { 'class': className }, '\u00a0'); vim.fakeCursorBookmark = cm.setBookmark(from, {widget: widget}); } else { vim.fakeCursor = cm.markText(from, to, {className: className}); diff --git a/front_end/third_party/codemirror/package/lib/codemirror.css b/front_end/third_party/codemirror/package/lib/codemirror.css index 5ea2d2be2a..a64f97c777 100644 --- a/front_end/third_party/codemirror/package/lib/codemirror.css +++ b/front_end/third_party/codemirror/package/lib/codemirror.css @@ -19,7 +19,7 @@ } .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: transparent; /* The little square between H and V scrollbars */ + background-color: white; /* The little square between H and V scrollbars */ } /* GUTTER */ diff --git a/front_end/third_party/codemirror/package/lib/codemirror.js b/front_end/third_party/codemirror/package/lib/codemirror.js index 149b6fd985..e4bc4a0e64 100644 --- a/front_end/third_party/codemirror/package/lib/codemirror.js +++ b/front_end/third_party/codemirror/package/lib/codemirror.js @@ -4798,19 +4798,19 @@ }); } - function History(startGen) { + function History(prev) { // Arrays of change events and selections. Doing something adds an // event to done and clears undo. Undoing moves events from done // to undone, redoing moves them in the other direction. this.done = []; this.undone = []; - this.undoDepth = Infinity; + this.undoDepth = prev ? prev.undoDepth : Infinity; // Used to track when changes can be merged into a single undo // event this.lastModTime = this.lastSelTime = 0; this.lastOp = this.lastSelOp = null; this.lastOrigin = this.lastSelOrigin = null; // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1; + this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; } // Create a history change event from an updateDoc-style change @@ -5115,7 +5115,7 @@ (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - if (!(options && options.scroll === false) && doc.cm) + if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") { ensureCursorVisible(doc.cm); } } @@ -6244,7 +6244,7 @@ clearHistory: function() { var this$1 = this; - this.history = new History(this.history.maxGeneration); + this.history = new History(this.history); linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true); }, @@ -6265,7 +6265,7 @@ undone: copyHistoryArray(this.history.undone)} }, setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration); + var hist = this.history = new History(this.history); hist.done = copyHistoryArray(histData.done.slice(0), null, true); hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); }, @@ -7708,7 +7708,7 @@ for (var i = newBreaks.length - 1; i >= 0; i--) { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } }); - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); if (old != Init) { cm.refresh(); } }); @@ -8675,7 +8675,7 @@ function moveOnce(boundToLine) { var next; if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (unit > 0 ? 0 : -1)); + var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); if (isNaN(ch)) { next = null; } else { @@ -9793,7 +9793,7 @@ addLegacyProps(CodeMirror); - CodeMirror.version = "5.59.1"; + CodeMirror.version = "5.59.4"; return CodeMirror; diff --git a/front_end/third_party/codemirror/package/mode/asn.1/asn.1.js b/front_end/third_party/codemirror/package/mode/asn.1/asn.1.js index d3ecb08781..df1330b686 100644 --- a/front_end/third_party/codemirror/package/mode/asn.1/asn.1.js +++ b/front_end/third_party/codemirror/package/mode/asn.1/asn.1.js @@ -190,7 +190,7 @@ " NetworkAddress BITS BMPString TimeStamp TimeTicks" + " TruthValue RowStatus DisplayString GeneralString" + " GraphicString IA5String NumericString" + - " PrintableString SnmpAdminAtring TeletexString" + + " PrintableString SnmpAdminString TeletexString" + " UTF8String VideotexString VisibleString StringStore" + " ISO646String T61String UniversalString Unsigned32" + " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), diff --git a/front_end/third_party/codemirror/package/mode/clike/clike.js b/front_end/third_party/codemirror/package/mode/clike/clike.js index 2154f1d2df..05b8f77f1d 100644 --- a/front_end/third_party/codemirror/package/mode/clike/clike.js +++ b/front_end/third_party/codemirror/package/mode/clike/clike.js @@ -350,8 +350,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { function cpp11StringHook(stream, state) { stream.backUp(1); // Raw strings. - if (stream.match(/(R|u8R|uR|UR|LR)/)) { - var match = stream.match(/"([^\s\\()]{0,16})\(/); + if (stream.match(/^(?:R|u8R|uR|UR|LR)/)) { + var match = stream.match(/^"([^\s\\()]{0,16})\(/); if (!match) { return false; } @@ -360,8 +360,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { return tokenRawString(stream, state); } // Unicode strings/chars. - if (stream.match(/(u8|u|U|L)/)) { - if (stream.match(/["']/, /* eat */ false)) { + if (stream.match(/^(?:u8|u|U|L)/)) { + if (stream.match(/^["']/, /* eat */ false)) { return "string"; } return false; @@ -749,7 +749,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + - "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + + "gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + "gl_ProjectionMatrixInverseTranspose " + "gl_ModelViewProjectionMatrixInverseTranspose " + "gl_TextureMatrixInverseTranspose " + diff --git a/front_end/third_party/codemirror/package/mode/css/css.js b/front_end/third_party/codemirror/package/mode/css/css.js index 240c270a90..88a869bfea 100644 --- a/front_end/third_party/codemirror/package/mode/css/css.js +++ b/front_end/third_party/codemirror/package/mode/css/css.js @@ -78,8 +78,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return ret("qualifier", "qualifier"); } else if (/[:;{}\[\]\(\)]/.test(ch)) { return ret(null, ch); - } else if (stream.match(/[\w-.]+(?=\()/)) { - if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) { + } else if (stream.match(/^[\w-.]+(?=\()/)) { + if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) { state.tokenize = tokenParenthesized; } return ret("variable callee", "variable"); @@ -108,7 +108,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { function tokenParenthesized(stream, state) { stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\')]/, false)) + if (!stream.match(/^\s*[\"\')]/, false)) state.tokenize = tokenString(")"); else state.tokenize = null; @@ -781,7 +781,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { } }, ":": function(stream) { - if (stream.match(/\s*\{/, false)) + if (stream.match(/^\s*\{/, false)) return [null, null] return false; }, diff --git a/front_end/third_party/codemirror/package/mode/cypher/cypher.js b/front_end/third_party/codemirror/package/mode/cypher/cypher.js index aa76eb9e34..6d88fa0eda 100644 --- a/front_end/third_party/codemirror/package/mode/cypher/cypher.js +++ b/front_end/third_party/codemirror/package/mode/cypher/cypher.js @@ -21,11 +21,11 @@ var tokenBase = function(stream/*, state*/) { var ch = stream.next(); if (ch ==='"') { - stream.match(/.*?"/); + stream.match(/^[^"]*"/); return "string"; } if (ch === "'") { - stream.match(/.*?'/); + stream.match(/^[^']*'/); return "string"; } if (/[{}\(\),\.;\[\]]/.test(ch)) { diff --git a/front_end/third_party/codemirror/package/mode/dtd/dtd.js b/front_end/third_party/codemirror/package/mode/dtd/dtd.js index 74b8c6bded..1bff91cbab 100644 --- a/front_end/third_party/codemirror/package/mode/dtd/dtd.js +++ b/front_end/third_party/codemirror/package/mode/dtd/dtd.js @@ -34,7 +34,7 @@ CodeMirror.defineMode("dtd", function(config) { state.tokenize = inBlock("meta", "?>"); return ret("meta", ch); } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag"); - else if (ch == "|") return ret("keyword", "seperator"); + else if (ch == "|") return ret("keyword", "separator"); else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else else if (ch.match(/[\[\]]/)) return ret("rule", ch); else if (ch == "\"" || ch == "'") { @@ -112,7 +112,7 @@ CodeMirror.defineMode("dtd", function(config) { indent: function(state, textAfter) { var n = state.stack.length; - if( textAfter.match(/\]\s+|\]/) )n=n-1; + if( textAfter.charAt(0) === ']' )n--; else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ if(textAfter.substr(0,1) === "<") {} else if( type == "doindent" && textAfter.length > 1 ) {} diff --git a/front_end/third_party/codemirror/package/mode/ebnf/ebnf.js b/front_end/third_party/codemirror/package/mode/ebnf/ebnf.js index 238bbe23bf..d8fb3f3a2f 100644 --- a/front_end/third_party/codemirror/package/mode/ebnf/ebnf.js +++ b/front_end/third_party/codemirror/package/mode/ebnf/ebnf.js @@ -41,10 +41,10 @@ state.stringType = stream.peek(); stream.next(); // Skip quote state.stack.unshift(stateType._string); - } else if (stream.match(/^\/\*/)) { //comments starting with /* + } else if (stream.match('/*')) { //comments starting with /* state.stack.unshift(stateType.comment); state.commentType = commentType.slash; - } else if (stream.match(/^\(\*/)) { //comments starting with (* + } else if (stream.match('(*')) { //comments starting with (* state.stack.unshift(stateType.comment); state.commentType = commentType.parenthesis; } @@ -69,10 +69,10 @@ case stateType.comment: while (state.stack[0] === stateType.comment && !stream.eol()) { - if (state.commentType === commentType.slash && stream.match(/\*\//)) { + if (state.commentType === commentType.slash && stream.match('*/')) { state.stack.shift(); // Clear flag state.commentType = null; - } else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) { + } else if (state.commentType === commentType.parenthesis && stream.match('*)')) { state.stack.shift(); // Clear flag state.commentType = null; } else { @@ -83,7 +83,7 @@ case stateType.characterClass: while (state.stack[0] === stateType.characterClass && !stream.eol()) { - if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { + if (!(stream.match(/^[^\]\\]+/) || stream.match('.'))) { state.stack.shift(); } } @@ -168,10 +168,10 @@ } } - if (stream.match(/^\/\//)) { + if (stream.match('//')) { stream.skipToEnd(); return "comment"; - } else if (stream.match(/return/)) { + } else if (stream.match('return')) { return "operator"; } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) { if (stream.match(/(?=[\(.])/)) { diff --git a/front_end/third_party/codemirror/package/mode/factor/factor.js b/front_end/third_party/codemirror/package/mode/factor/factor.js index 7108278cca..4c876d4d29 100644 --- a/front_end/third_party/codemirror/package/mode/factor/factor.js +++ b/front_end/third_party/codemirror/package/mode/factor/factor.js @@ -16,7 +16,7 @@ "use strict"; CodeMirror.defineSimpleMode("factor", { - // The start state contains the rules that are intially used + // The start state contains the rules that are initially used start: [ // comments {regex: /#?!.*/, token: "comment"}, diff --git a/front_end/third_party/codemirror/package/mode/gas/gas.js b/front_end/third_party/codemirror/package/mode/gas/gas.js index e34d7a7b61..b3515abe77 100644 --- a/front_end/third_party/codemirror/package/mode/gas/gas.js +++ b/front_end/third_party/codemirror/package/mode/gas/gas.js @@ -302,11 +302,11 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) { } if (ch === '{') { - return "braket"; + return "bracket"; } if (ch === '}') { - return "braket"; + return "bracket"; } if (/\d/.test(ch)) { diff --git a/front_end/third_party/codemirror/package/mode/haml/haml.js b/front_end/third_party/codemirror/package/mode/haml/haml.js index 3c8f505eb5..d941d97433 100644 --- a/front_end/third_party/codemirror/package/mode/haml/haml.js +++ b/front_end/third_party/codemirror/package/mode/haml/haml.js @@ -72,7 +72,7 @@ } } - // donot handle --> as valid ruby, make it HTML close comment instead + // do not handle --> as valid ruby, make it HTML close comment instead if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { state.tokenize = ruby; return state.tokenize(stream, state); diff --git a/front_end/third_party/codemirror/package/mode/idl/idl.js b/front_end/third_party/codemirror/package/mode/idl/idl.js index 168761cd88..37302bb90f 100644 --- a/front_end/third_party/codemirror/package/mode/idl/idl.js +++ b/front_end/third_party/codemirror/package/mode/idl/idl.js @@ -62,7 +62,7 @@ 'empty', 'enable_sysrtn', 'eof', 'eos', 'erase', 'erf', 'erfc', 'erfcx', 'erode', 'errorplot', 'errplot', 'estimator_filter', 'execute', 'exit', 'exp', - 'expand', 'expand_path', 'expint', 'extrac', 'extract_slice', + 'expand', 'expand_path', 'expint', 'extract', 'extract_slice', 'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename', 'file_chmod', 'file_copy', 'file_delete', 'file_dirname', 'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info', diff --git a/front_end/third_party/codemirror/package/mode/javascript/javascript.js b/front_end/third_party/codemirror/package/mode/javascript/javascript.js index 966ffef063..047395622e 100644 --- a/front_end/third_party/codemirror/package/mode/javascript/javascript.js +++ b/front_end/third_party/codemirror/package/mode/javascript/javascript.js @@ -624,7 +624,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "=>") return cont(typeexpr) } function typeprops(type) { - if (type == "}") return cont() + if (type.match(/[\}\)\]]/)) return cont() if (type == "," || type == ";") return cont(typeprops) return pass(typeprop, typeprops) } diff --git a/front_end/third_party/codemirror/package/mode/julia/julia.js b/front_end/third_party/codemirror/package/mode/julia/julia.js index 3942492042..bff5413b85 100644 --- a/front_end/third_party/codemirror/package/mode/julia/julia.js +++ b/front_end/third_party/codemirror/package/mode/julia/julia.js @@ -80,7 +80,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { // tokenizers function tokenBase(stream, state) { // Handle multiline comments - if (stream.match(/^#=/, false)) { + if (stream.match('#=', false)) { state.tokenize = tokenComment; return state.tokenize(stream, state); } @@ -141,10 +141,10 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } if (inArray(state)) { - if (state.lastToken == "end" && stream.match(/^:/)) { + if (state.lastToken == "end" && stream.match(':')) { return "operator"; } - if (stream.match(/^end/)) { + if (stream.match('end')) { return "number"; } } @@ -201,7 +201,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } // Handle Chars - if (stream.match(/^'/)) { + if (stream.match('\'')) { state.tokenize = tokenChar; return state.tokenize(stream, state); } @@ -263,7 +263,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { state.scopes.push('('); charsAdvanced += match[1].length; } - if (currentScope(state) == '(' && stream.match(/^\)/)) { + if (currentScope(state) == '(' && stream.match(')')) { state.scopes.pop(); charsAdvanced += 1; if (state.scopes.length <= state.firstParenPos) { @@ -295,10 +295,10 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } function tokenAnnotation(stream, state) { - stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/); - if (stream.match(/^{/)) { + stream.match(/.*?(?=[,;{}()=\s]|$)/); + if (stream.match('{')) { state.nestedParameters++; - } else if (stream.match(/^}/) && state.nestedParameters > 0) { + } else if (stream.match('}') && state.nestedParameters > 0) { state.nestedParameters--; } if (state.nestedParameters > 0) { @@ -310,13 +310,13 @@ CodeMirror.defineMode("julia", function(config, parserConf) { } function tokenComment(stream, state) { - if (stream.match(/^#=/)) { + if (stream.match('#=')) { state.nestedComments++; } if (!stream.match(/.*?(?=(#=|=#))/)) { stream.skipToEnd(); } - if (stream.match(/^=#/)) { + if (stream.match('=#')) { state.nestedComments--; if (state.nestedComments == 0) state.tokenize = tokenBase; @@ -347,7 +347,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) { return "string"; } if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); } - if (stream.match(/^'/)) { state.tokenize = tokenBase; } + if (stream.match('\'')) { state.tokenize = tokenBase; } return "error"; } diff --git a/front_end/third_party/codemirror/package/mode/markdown/markdown.js b/front_end/third_party/codemirror/package/mode/markdown/markdown.js index 287f39b55d..038a776bdc 100644 --- a/front_end/third_party/codemirror/package/mode/markdown/markdown.js +++ b/front_end/third_party/codemirror/package/mode/markdown/markdown.js @@ -223,7 +223,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { // Add this list item's content's indentation to the stack state.listStack.push(state.indentation); - // Reset inline styles which shouldn't propagate aross list items + // Reset inline styles which shouldn't propagate across list items state.em = false; state.strong = false; state.code = false; @@ -612,7 +612,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return getType(state); } } else if (ch === ' ') { - if (stream.match(/^~~/, true)) { // Probably surrounded by space + if (stream.match('~~', true)) { // Probably surrounded by space if (stream.peek() === ' ') { // Surrounded by spaces, ignore return getType(state); } else { // Not surrounded by spaces, back up pointer @@ -711,7 +711,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } function footnoteLinkInside(stream, state) { - if (stream.match(/^\]:/, true)) { + if (stream.match(']:', true)) { state.f = state.inline = footnoteUrl; if (modeCfg.highlightFormatting) state.formatting = "link"; var returnType = getType(state); @@ -735,7 +735,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (stream.peek() === undefined) { // End of line, set flag to check next line state.linkTitle = true; } else { // More content on line, check if link title - stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); + stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true); } state.f = state.inline = inlineNormal; return tokenTypes.linkHref + " url"; diff --git a/front_end/third_party/codemirror/package/mode/meta.js b/front_end/third_party/codemirror/package/mode/meta.js index c7738a514c..92b68074ca 100644 --- a/front_end/third_party/codemirror/package/mode/meta.js +++ b/front_end/third_party/codemirror/package/mode/meta.js @@ -44,7 +44,7 @@ {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]}, {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, + {name: "Embedded JavaScript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, {name: "Esper", mime: "text/x-esper", mode: "sql"}, diff --git a/front_end/third_party/codemirror/package/mode/modelica/modelica.js b/front_end/third_party/codemirror/package/mode/modelica/modelica.js index a83a4135d0..2e9622f03f 100644 --- a/front_end/third_party/codemirror/package/mode/modelica/modelica.js +++ b/front_end/third_party/codemirror/package/mode/modelica/modelica.js @@ -90,7 +90,7 @@ return "error"; } - function tokenUnsignedNuber(stream, state) { + function tokenUnsignedNumber(stream, state) { stream.eatWhile(isDigit); if (stream.eat('.')) { stream.eatWhile(isDigit); @@ -164,9 +164,9 @@ else if(ch == '"') { state.tokenize = tokenString; } - // UNSIGNED_NUBER + // UNSIGNED_NUMBER else if(isDigit.test(ch)) { - state.tokenize = tokenUnsignedNuber; + state.tokenize = tokenUnsignedNumber; } // ERROR else { diff --git a/front_end/third_party/codemirror/package/mode/mscgen/mscgen.js b/front_end/third_party/codemirror/package/mode/mscgen/mscgen.js index 6f4f9cd8f0..8d39341cf9 100644 --- a/front_end/third_party/codemirror/package/mode/mscgen/mscgen.js +++ b/front_end/third_party/codemirror/package/mode/mscgen/mscgen.js @@ -72,11 +72,11 @@ CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); function wordRegexpBoundary(pWords) { - return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); + return new RegExp("^\\b(?:" + pWords.join("|") + ")\\b", "i"); } function wordRegexp(pWords) { - return new RegExp("(" + pWords.join("|") + ")", "i"); + return new RegExp("^(?:" + pWords.join("|") + ")", "i"); } function startStateFn() { @@ -153,7 +153,7 @@ return "variable"; /* attribute lists */ - if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { + if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match('[', true, true)) { pConfig.inAttributeList = true; return "bracket"; } @@ -161,7 +161,7 @@ if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { return "attribute"; } - if (pStream.match(/]/, true, true)) { + if (pStream.match(']', true, true)) { pConfig.inAttributeList = false; return "bracket"; } diff --git a/front_end/third_party/codemirror/package/mode/mumps/mumps.js b/front_end/third_party/codemirror/package/mode/mumps/mumps.js index 3671c9cb36..c53b4bf3a2 100644 --- a/front_end/third_party/codemirror/package/mode/mumps/mumps.js +++ b/front_end/third_party/codemirror/package/mode/mumps/mumps.js @@ -26,7 +26,7 @@ var brackets = new RegExp("[()]"); var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; - // The following list includes instrinsic functions _and_ special variables + // The following list includes intrinsic functions _and_ special variables var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); var command = wordRegexp(commandKeywords); diff --git a/front_end/third_party/codemirror/package/mode/oz/oz.js b/front_end/third_party/codemirror/package/mode/oz/oz.js index a9738495b6..73857e4c7e 100644 --- a/front_end/third_party/codemirror/package/mode/oz/oz.js +++ b/front_end/third_party/codemirror/package/mode/oz/oz.js @@ -45,7 +45,7 @@ CodeMirror.defineMode("oz", function (conf) { } // Special [] keyword - if (stream.match(/(\[])/)) { + if (stream.match('[]')) { return "keyword" } @@ -130,7 +130,7 @@ CodeMirror.defineMode("oz", function (conf) { return "operator"; } - // If nothing match, we skip the entire alphanumerical block + // If nothing match, we skip the entire alphanumeric block stream.eatWhile(/\w/); return "variable"; diff --git a/front_end/third_party/codemirror/package/mode/pegjs/pegjs.js b/front_end/third_party/codemirror/package/mode/pegjs/pegjs.js index 19d5fa4c02..ac011d3c8f 100644 --- a/front_end/third_party/codemirror/package/mode/pegjs/pegjs.js +++ b/front_end/third_party/codemirror/package/mode/pegjs/pegjs.js @@ -39,7 +39,7 @@ CodeMirror.defineMode("pegjs", function (config) { stream.next(); // Skip quote state.inString = true; // Update state } - if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { + if (!state.inString && !state.inComment && stream.match('/*')) { state.inComment = true; } @@ -59,7 +59,7 @@ CodeMirror.defineMode("pegjs", function (config) { return state.lhs ? "property string" : "string"; // Token style } else if (state.inComment) { while (state.inComment && !stream.eol()) { - if (stream.match(/\*\//)) { + if (stream.match('*/')) { state.inComment = false; // Clear flag } else { stream.match(/^.[^\*]*/); @@ -76,7 +76,7 @@ CodeMirror.defineMode("pegjs", function (config) { stream.next(); state.inCharacterClass = true; return 'bracket'; - } else if (stream.match(/^\/\//)) { + } else if (stream.match('//')) { stream.skipToEnd(); return "comment"; } else if (state.braced || stream.peek() === '{') { diff --git a/front_end/third_party/codemirror/package/mode/perl/perl.js b/front_end/third_party/codemirror/package/mode/perl/perl.js index 220b0a6994..ffe7877af1 100644 --- a/front_end/third_party/codemirror/package/mode/perl/perl.js +++ b/front_end/third_party/codemirror/package/mode/perl/perl.js @@ -347,7 +347,7 @@ CodeMirror.defineMode("perl",function(){ lc :1, // - return lower-case version of a string lcfirst :1, // - return a string with just the next letter in lower case length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem + 'link' :1, // - create a hard link in the filesystem listen :1, // - register your socket as a server local : 2, // - create a temporary value for a global variable (dynamic scoping) localtime :1, // - convert UNIX time into record or string using local time @@ -441,7 +441,7 @@ CodeMirror.defineMode("perl",function(){ state :1, // - declare and assign a state variable (persistent lexical scoping) study :1, // - optimize input data for repeated searches 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng + 'substr' :1, // - get or alter a portion of a string symlink :1, // - create a symbolic link to a file syscall :1, // - execute an arbitrary system call sysopen :1, // - open a file, pipe, or descriptor diff --git a/front_end/third_party/codemirror/package/mode/php/php.js b/front_end/third_party/codemirror/package/mode/php/php.js index 5f3a143999..3202f50724 100644 --- a/front_end/third_party/codemirror/package/mode/php/php.js +++ b/front_end/third_party/codemirror/package/mode/php/php.js @@ -53,7 +53,7 @@ [["]", null]] ], closing, escapes); } - if (stream.match(/\-\>\w/, false)) { + if (stream.match(/^->\w/, false)) { // Match object operator state.tokenize = matchSequence([ [["->", null]], @@ -106,7 +106,7 @@ }, "<": function(stream, state) { var before; - if (before = stream.match(/<<\s*/)) { + if (before = stream.match(/^<<\s*/)) { var quoted = stream.eat(/['"]/); stream.eatWhile(/[\w\.]/); var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1)); diff --git a/front_end/third_party/codemirror/package/mode/pug/pug.js b/front_end/third_party/codemirror/package/mode/pug/pug.js index a4c0e16b83..73e9ae2fc8 100644 --- a/front_end/third_party/codemirror/package/mode/pug/pug.js +++ b/front_end/third_party/codemirror/package/mode/pug/pug.js @@ -261,7 +261,7 @@ CodeMirror.defineMode("pug", function (config) { } return 'variable'; } - if (stream.match(/^\+#{/, false)) { + if (stream.match('+#{', false)) { stream.next(); state.mixinCallAfter = true; return interpolation(stream, state); diff --git a/front_end/third_party/codemirror/package/mode/puppet/puppet.js b/front_end/third_party/codemirror/package/mode/puppet/puppet.js index 364934209e..a92ca1107b 100644 --- a/front_end/third_party/codemirror/package/mode/puppet/puppet.js +++ b/front_end/third_party/codemirror/package/mode/puppet/puppet.js @@ -176,7 +176,7 @@ CodeMirror.defineMode("puppet", function () { // Match characters that we are going to assume // are trying to be regex if (ch == '/') { - stream.match(/.*?\//); + stream.match(/^[^\/]*\//); return 'variable-3'; } // Match all the numbers diff --git a/front_end/third_party/codemirror/package/mode/rpm/rpm.js b/front_end/third_party/codemirror/package/mode/rpm/rpm.js index 2dece2eabd..bb9ec9ffad 100644 --- a/front_end/third_party/codemirror/package/mode/rpm/rpm.js +++ b/front_end/third_party/codemirror/package/mode/rpm/rpm.js @@ -12,14 +12,14 @@ "use strict"; CodeMirror.defineMode("rpm-changes", function() { - var headerSeperator = /^-+$/; + var headerSeparator = /^-+$/; var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; var simpleEmail = /^[\w+.-]+@[\w.-]+/; return { token: function(stream) { if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } + if (stream.match(headerSeparator)) { return 'tag'; } if (stream.match(headerLine)) { return 'tag'; } } if (stream.match(simpleEmail)) { return 'string'; } @@ -80,12 +80,12 @@ CodeMirror.defineMode("rpm-spec", function() { // Macros like '%make_install' or '%attr(0775,root,root)' if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } + if (stream.match('(')) { state.macroParameters = true; } return "keyword"; } if (state.macroParameters) { if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { + if (stream.match(')')) { state.macroParameters = false; return "keyword"; } diff --git a/front_end/third_party/codemirror/package/mode/sass/sass.js b/front_end/third_party/codemirror/package/mode/sass/sass.js index c37ab0b28f..1258e142c3 100644 --- a/front_end/third_party/codemirror/package/mode/sass/sass.js +++ b/front_end/third_party/codemirror/package/mode/sass/sass.js @@ -231,7 +231,7 @@ CodeMirror.defineMode("sass", function(config) { } if(ch === "@"){ - if(stream.match(/@extend/)){ + if(stream.match('@extend')){ if(!stream.match(/\s*[\w]/)) dedent(state); } diff --git a/front_end/third_party/codemirror/package/mode/scheme/scheme.js b/front_end/third_party/codemirror/package/mode/scheme/scheme.js index efac89078b..370250d856 100644 --- a/front_end/third_party/codemirror/package/mode/scheme/scheme.js +++ b/front_end/third_party/codemirror/package/mode/scheme/scheme.js @@ -170,7 +170,7 @@ CodeMirror.defineMode("scheme", function () { } else if (stream.match(/^[-+0-9.]/, false)) { hasRadix = false; numTest = isDecimalNumber; - // re-consume the intial # if all matches failed + // re-consume the initial # if all matches failed } else if (!hasExactness) { stream.eat('#'); } diff --git a/front_end/third_party/codemirror/package/mode/sieve/sieve.js b/front_end/third_party/codemirror/package/mode/sieve/sieve.js index f02a867e7a..b7236401a7 100644 --- a/front_end/third_party/codemirror/package/mode/sieve/sieve.js +++ b/front_end/third_party/codemirror/package/mode/sieve/sieve.js @@ -43,7 +43,7 @@ CodeMirror.defineMode("sieve", function(config) { if (ch == "(") { state._indent.push("("); // add virtual angel wings so that editor behaves... - // ...more sane incase of broken brackets + // ...more sane in case of broken brackets state._indent.push("{"); return null; } diff --git a/front_end/third_party/codemirror/package/mode/soy/soy.js b/front_end/third_party/codemirror/package/mode/soy/soy.js index e3427ebe3c..1f8a13c47d 100644 --- a/front_end/third_party/codemirror/package/mode/soy/soy.js +++ b/front_end/third_party/codemirror/package/mode/soy/soy.js @@ -411,7 +411,7 @@ return null; case "list-literal": - if (stream.match(/\]/)) { + if (stream.match(']')) { state.soyState.pop(); state.lookupVariables = true; popcontext(state); @@ -517,14 +517,14 @@ } return expression(stream, state); case "literal": - if (stream.match(/^(?=\{\/literal})/)) { + if (stream.match('{/literal}', false)) { state.soyState.pop(); return this.token(stream, state); } return tokenUntil(stream, state, /\{\/literal}/); } - if (stream.match(/^\{literal}/)) { + if (stream.match('{literal}')) { state.indent += config.indentUnit; state.soyState.push("literal"); state.context = new Context(state.context, "literal", state.variables); @@ -581,12 +581,12 @@ state.soyState.push("import"); state.indent += 2 * config.indentUnit; return "keyword"; - } else if (match = stream.match(/^<\{/)) { + } else if (match = stream.match('<{')) { state.soyState.push("template-call-expression"); state.indent += 2 * config.indentUnit; state.soyState.push("tag"); return "keyword"; - } else if (match = stream.match(/^<\/>/)) { + } else if (match = stream.match('')) { state.indent -= 1 * config.indentUnit; return "keyword"; } diff --git a/front_end/third_party/codemirror/package/mode/sql/sql.js b/front_end/third_party/codemirror/package/mode/sql/sql.js index 4127cd9a05..ead4d6db23 100644 --- a/front_end/third_party/codemirror/package/mode/sql/sql.js +++ b/front_end/third_party/codemirror/package/mode/sql/sql.js @@ -243,9 +243,9 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { // varName can be quoted with ` or ' or " // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); + stream.match('session.'); + stream.match('local.'); + stream.match('global.'); } if (stream.eat("'")) { @@ -370,7 +370,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { "$": hookVar, // The preferred way to escape Identifiers is using double quotes, ref: http://sqlite.org/lang_keywords.html "\"": hookIdentifierDoublequote, - // there is also support for backtics, ref: http://sqlite.org/lang_keywords.html + // there is also support for backticks, ref: http://sqlite.org/lang_keywords.html "`": hookIdentifier } }); @@ -451,7 +451,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { // Spark SQL CodeMirror.defineMIME("text/x-sparksql", { name: "sql", - keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), + keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), builtin: set("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"), atoms: set("false true null"), operatorChars: /^[*\/+\-%<>!=~&|^]/, diff --git a/front_end/third_party/codemirror/package/mode/stylus/stylus.js b/front_end/third_party/codemirror/package/mode/stylus/stylus.js index eecc554bc0..5cddff0320 100644 --- a/front_end/third_party/codemirror/package/mode/stylus/stylus.js +++ b/front_end/third_party/codemirror/package/mode/stylus/stylus.js @@ -138,7 +138,7 @@ // Variable if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { if (!wordIsTag(stream.current())) { - stream.match(/\./); + stream.match('.'); return ["variable-2", "variable-name"]; } } diff --git a/front_end/third_party/codemirror/package/mode/tiddlywiki/tiddlywiki.js b/front_end/third_party/codemirror/package/mode/tiddlywiki/tiddlywiki.js index a4fb89f658..6a9ce447ba 100644 --- a/front_end/third_party/codemirror/package/mode/tiddlywiki/tiddlywiki.js +++ b/front_end/third_party/codemirror/package/mode/tiddlywiki/tiddlywiki.js @@ -114,7 +114,7 @@ CodeMirror.defineMode("tiddlywiki", function () { return 'header'; } - if (ch == '{' && stream.match(/\{\{/)) + if (ch == '{' && stream.match('{{')) return chain(stream, state, twTokenCode); // rudimentary html:// file:// link matching. TW knows much more ... diff --git a/front_end/third_party/codemirror/package/mode/vbscript/vbscript.js b/front_end/third_party/codemirror/package/mode/vbscript/vbscript.js index 0670c0ceef..4033948133 100644 --- a/front_end/third_party/codemirror/package/mode/vbscript/vbscript.js +++ b/front_end/third_party/codemirror/package/mode/vbscript/vbscript.js @@ -32,7 +32,7 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); var singleDelimiters = new RegExp('^[\\.,]'); - var brakets = new RegExp('^[\\(\\)]'); + var brackets = new RegExp('^[\\(\\)]'); var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; @@ -183,7 +183,7 @@ CodeMirror.defineMode("vbscript", function(conf, parserConf) { return null; } - if (stream.match(brakets)) { + if (stream.match(brackets)) { return "bracket"; } diff --git a/front_end/third_party/codemirror/package/mode/velocity/velocity.js b/front_end/third_party/codemirror/package/mode/velocity/velocity.js index 56caa671b3..1d17c84ebe 100644 --- a/front_end/third_party/codemirror/package/mode/velocity/velocity.js +++ b/front_end/third_party/codemirror/package/mode/velocity/velocity.js @@ -48,7 +48,7 @@ CodeMirror.defineMode("velocity", function() { else if (state.inParams) return chain(stream, state, tokenString(ch)); } - // is it one of the special signs []{}().,;? Seperator? + // is it one of the special signs []{}().,;? Separator? else if (/[\[\]{}\(\),;\.]/.test(ch)) { if (ch == "(" && beforeParams) state.inParams = true; diff --git a/front_end/third_party/codemirror/package/mode/verilog/verilog.js b/front_end/third_party/codemirror/package/mode/verilog/verilog.js index 89fe9c1ac8..6c799f298b 100644 --- a/front_end/third_party/codemirror/package/mode/verilog/verilog.js +++ b/front_end/third_party/codemirror/package/mode/verilog/verilog.js @@ -542,7 +542,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { }; var tlvIndentUnit = 3; var tlvTrackStatements = false; - var tlvIdentMatch = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/; // Matches an identifiere. + var tlvIdentMatch = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/; // Matches an identifier. // Note that ':' is excluded, because of it's use in [:]. var tlvFirstLevelIndentMatch = /^[! ] /; var tlvLineIndentationMatch = /^[! ] */; @@ -719,7 +719,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { } else { // Just swallow one character and try again. // This enables subsequent identifier match with preceding symbol character, which - // is legal within a statement. (Eg, !$reset). It also enables detection of + // is legal within a statement. (E.g., !$reset). It also enables detection of // comment start with preceding symbols. stream.backUp(stream.current().length - 1); style = "tlv-default"; diff --git a/front_end/third_party/codemirror/package/mode/wast/wast.js b/front_end/third_party/codemirror/package/mode/wast/wast.js index a730d39efc..9348ad3e0a 100644 --- a/front_end/third_party/codemirror/package/mode/wast/wast.js +++ b/front_end/third_party/codemirror/package/mode/wast/wast.js @@ -14,8 +14,8 @@ CodeMirror.defineSimpleMode('wast', { start: [ {regex: /[+\-]?(?:nan(?::0x[0-9a-fA-F]+)?|infinity|inf|0x[0-9a-fA-F]+\.?[0-9a-fA-F]*p[+\/-]?\d+|\d+(?:\.\d*)?[eE][+\-]?\d*|\d+\.\d*|0x[0-9a-fA-F]+|\d+)/, token: "number"}, - {regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|\bfunc\b|param|result|local|global|module|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs|sqrt|mul|div|min|max)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)|i16x8\.(load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su]|mul)|i32x4\.(load16x4_[su]|widen_(low|high)_i16x8_[su]|mul|trunc_sat_f32x4_[su])|i64x2\.(load32x2_[su]|mul)|(v(8x16|16x8|32x4|64x2)\.load_splat)|i8x16\.narrow_i16x8_[su]|f32x4\.convert_i32x4_[su]|ref\.(func|(is_)?null)|\bextern\b|table(\.(size|get|set|size|grow|fill|init|copy))?/, token: "keyword"}, - {regex: /\b(funcref|externref|[fi](32|64))\b/, token: "atom"}, + {regex: /mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|func|param|result|local|global|module|table|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs|sqrt|mul|div|min|max)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)|i16x8\.(load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su]|mul)|i32x4\.(load16x4_[su]|widen_(low|high)_i16x8_[su]|mul|trunc_sat_f32x4_[su])|i64x2\.(load32x2_[su]|mul)|(v(8x16|16x8|32x4|64x2)\.load_splat)|i8x16\.narrow_i16x8_[su]|f32x4\.convert_i32x4_[su]/, token: "keyword"}, + {regex: /\b(anyfunc|[fi](32|64))\b/, token: "atom"}, {regex: /\$([a-zA-Z0-9_`\+\-\*\/\\\^~=<>!\?@#$%&|:\.]+)/, token: "variable-2"}, {regex: /"(?:[^"\\\x00-\x1f\x7f]|\\[nt\\'"]|\\[0-9a-fA-F][0-9a-fA-F])*"/, token: "string"}, {regex: /\(;.*?/, token: "comment", next: "comment"}, diff --git a/front_end/third_party/codemirror/package/mode/yaml-frontmatter/yaml-frontmatter.js b/front_end/third_party/codemirror/package/mode/yaml-frontmatter/yaml-frontmatter.js index 87fdf80d07..f9050ad6a8 100644 --- a/front_end/third_party/codemirror/package/mode/yaml-frontmatter/yaml-frontmatter.js +++ b/front_end/third_party/codemirror/package/mode/yaml-frontmatter/yaml-frontmatter.js @@ -36,7 +36,7 @@ }, token: function (stream, state) { if (state.state == START) { - if (stream.match(/---/, false)) { + if (stream.match('---', false)) { state.state = FRONTMATTER return yamlMode.token(stream, state.inner) } else { diff --git a/front_end/third_party/codemirror/package/mode/yaml/yaml.js b/front_end/third_party/codemirror/package/mode/yaml/yaml.js index a29d7ea4a7..d464941026 100644 --- a/front_end/third_party/codemirror/package/mode/yaml/yaml.js +++ b/front_end/third_party/codemirror/package/mode/yaml/yaml.js @@ -38,9 +38,9 @@ CodeMirror.defineMode("yaml", function() { state.pair = false; state.pairStart = false; /* document start */ - if(stream.match(/---/)) { return "def"; } + if(stream.match('---')) { return "def"; } /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } + if (stream.match('...')) { return "def"; } /* array list item */ if (stream.match(/\s*-\s+/)) { return 'meta'; } } @@ -57,12 +57,12 @@ CodeMirror.defineMode("yaml", function() { return 'meta'; } - /* list seperator */ + /* list separator */ if (state.inlineList > 0 && !esc && ch == ',') { stream.next(); return 'meta'; } - /* pairs seperator */ + /* pairs separator */ if (state.inlinePairs > 0 && !esc && ch == ',') { state.keyCol = 0; state.pair = false; diff --git a/front_end/third_party/codemirror/package/package.json b/front_end/third_party/codemirror/package/package.json index 7ab19be203..32df807768 100644 --- a/front_end/third_party/codemirror/package/package.json +++ b/front_end/third_party/codemirror/package/package.json @@ -1,6 +1,6 @@ { "name": "codemirror", - "version": "5.59.1", + "version": "5.59.4", "main": "lib/codemirror.js", "style": "lib/codemirror.css", "author": { diff --git a/front_end/third_party/codemirror/package/src/edit/main.js b/front_end/third_party/codemirror/package/src/edit/main.js index 5d29ac1147..c25c291cd2 100644 --- a/front_end/third_party/codemirror/package/src/edit/main.js +++ b/front_end/third_party/codemirror/package/src/edit/main.js @@ -66,4 +66,4 @@ import { addLegacyProps } from "./legacy.js" addLegacyProps(CodeMirror) -CodeMirror.version = "5.59.1" +CodeMirror.version = "5.59.4" diff --git a/front_end/third_party/codemirror/package/src/edit/methods.js b/front_end/third_party/codemirror/package/src/edit/methods.js index ccbc8ba034..63aaf05031 100644 --- a/front_end/third_party/codemirror/package/src/edit/methods.js +++ b/front_end/third_party/codemirror/package/src/edit/methods.js @@ -480,7 +480,7 @@ function findPosH(doc, pos, dir, unit, visually) { function moveOnce(boundToLine) { let next if (unit == "codepoint") { - let ch = lineObj.text.charCodeAt(pos.ch + (unit > 0 ? 0 : -1)) + let ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)) if (isNaN(ch)) { next = null } else { diff --git a/front_end/third_party/codemirror/package/src/edit/options.js b/front_end/third_party/codemirror/package/src/edit/options.js index 400e000327..8cb9cee065 100644 --- a/front_end/third_party/codemirror/package/src/edit/options.js +++ b/front_end/third_party/codemirror/package/src/edit/options.js @@ -68,7 +68,7 @@ export function defineOptions(CodeMirror) { for (let i = newBreaks.length - 1; i >= 0; i--) replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }) - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, (cm, val, old) => { + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, (cm, val, old) => { cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g") if (old != Init) cm.refresh() }) diff --git a/front_end/third_party/codemirror/package/src/model/Doc.js b/front_end/third_party/codemirror/package/src/model/Doc.js index 6f3eb170a5..857682a249 100644 --- a/front_end/third_party/codemirror/package/src/model/Doc.js +++ b/front_end/third_party/codemirror/package/src/model/Doc.js @@ -198,7 +198,7 @@ Doc.prototype = createObj(BranchChunk.prototype, { return {undo: done, redo: undone} }, clearHistory: function() { - this.history = new History(this.history.maxGeneration) + this.history = new History(this.history) linkedDocs(this, doc => doc.history = this.history, true) }, @@ -219,7 +219,7 @@ Doc.prototype = createObj(BranchChunk.prototype, { undone: copyHistoryArray(this.history.undone)} }, setHistory: function(histData) { - let hist = this.history = new History(this.history.maxGeneration) + let hist = this.history = new History(this.history) hist.done = copyHistoryArray(histData.done.slice(0), null, true) hist.undone = copyHistoryArray(histData.undone.slice(0), null, true) }, diff --git a/front_end/third_party/codemirror/package/src/model/history.js b/front_end/third_party/codemirror/package/src/model/history.js index 2d9359f007..a5bfbb38b0 100644 --- a/front_end/third_party/codemirror/package/src/model/history.js +++ b/front_end/third_party/codemirror/package/src/model/history.js @@ -8,19 +8,19 @@ import { changeEnd } from "./change_measurement.js" import { linkedDocs } from "./document_data.js" import { Selection } from "./selection.js" -export function History(startGen) { +export function History(prev) { // Arrays of change events and selections. Doing something adds an // event to done and clears undo. Undoing moves events from done // to undone, redoing moves them in the other direction. this.done = []; this.undone = [] - this.undoDepth = Infinity + this.undoDepth = prev ? prev.undoDepth : Infinity // Used to track when changes can be merged into a single undo // event this.lastModTime = this.lastSelTime = 0 this.lastOp = this.lastSelOp = null this.lastOrigin = this.lastSelOrigin = null // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1 + this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1 } // Create a history change event from an updateDoc-style change diff --git a/front_end/third_party/codemirror/package/src/model/selection_updates.js b/front_end/third_party/codemirror/package/src/model/selection_updates.js index 4fdfe52931..347a146364 100644 --- a/front_end/third_party/codemirror/package/src/model/selection_updates.js +++ b/front_end/third_party/codemirror/package/src/model/selection_updates.js @@ -106,7 +106,7 @@ export function setSelectionNoUndo(doc, sel, options) { (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1) setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)) - if (!(options && options.scroll === false) && doc.cm) + if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") ensureCursorVisible(doc.cm) } diff --git a/scripts/devtools_paths.js b/scripts/devtools_paths.js index 9c7769552a..e8025acca7 100644 --- a/scripts/devtools_paths.js +++ b/scripts/devtools_paths.js @@ -148,7 +148,7 @@ function stylelintExecutablePath() { function downloadedChromeBinaryPath() { const paths = { 'linux': path.join('chrome-linux', 'chrome'), - 'darwin': path.join('chrome', 'chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium'), + 'darwin': path.join('chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium'), 'win32': path.join('chrome-win', 'chrome.exe'), }; return path.join(thirdPartyPath(), 'chrome', paths[os.platform()]);