From 4d6402f8a6e54a5dce72e2d0b745f8f8e725622d Mon Sep 17 00:00:00 2001
From: Izheil <33794458+Izheil@users.noreply.github.com>
Date: Tue, 12 Apr 2022 05:52:57 +0200
Subject: [PATCH] Fix JS Loader issue
---
.../MultiRowTab-scrollable-autohide.uc.js | 13 +-
.../functions/MultiRowTab-scrollable.uc.js | 40 +-
.../functions/MultiRowTabLiteforFx.uc.js | 13 +-
.../Multirow & other functions/root/config.js | 28 +-
.../root/defaults/pref/config-prefs.js | 2 +-
.../Multirow & other functions/utils/boot.jsm | 14 -
.../utils/userChrome.jsm | 86 +-
.../utils/xPref.jsm | 2 +-
.../utils/QNModManager/CodeMirror/.travis.yml | 5 -
.../utils/QNModManager/CodeMirror/AUTHORS | 68 +
.../QNModManager/CodeMirror/CHANGELOG.md | 264 +++-
.../utils/QNModManager/CodeMirror/README.md | 3 +-
.../CodeMirror/addon/display/panel.js | 10 +-
.../CodeMirror/addon/display/placeholder.js | 15 +
.../CodeMirror/addon/edit/closebrackets.js | 22 +-
.../CodeMirror/addon/edit/closetag.js | 5 +-
.../CodeMirror/addon/edit/continuelist.js | 4 +-
.../CodeMirror/addon/edit/matchbrackets.js | 30 +-
.../CodeMirror/addon/fold/brace-fold.js | 94 +-
.../CodeMirror/addon/fold/foldcode.js | 10 +-
.../CodeMirror/addon/hint/html-hint.js | 1 +
.../CodeMirror/addon/hint/javascript-hint.js | 2 +-
.../CodeMirror/addon/hint/show-hint.js | 80 +-
.../CodeMirror/addon/hint/sql-hint.js | 6 +-
.../CodeMirror/addon/hint/xml-hint.js | 4 +-
.../CodeMirror/addon/lint/javascript-lint.js | 2 +
.../CodeMirror/addon/lint/lint.css | 32 +-
.../CodeMirror/addon/lint/lint.js | 84 +-
.../CodeMirror/addon/merge/merge.js | 3 +
.../CodeMirror/addon/mode/multiplex.js | 13 +-
.../CodeMirror/addon/mode/multiplex_test.js | 16 +
.../CodeMirror/addon/mode/simple.js | 4 +-
.../addon/runmode/runmode-standalone.js | 3 +-
.../CodeMirror/addon/runmode/runmode.js | 2 +-
.../CodeMirror/addon/runmode/runmode.node.js | 2 +-
.../CodeMirror/addon/search/jump-to-line.js | 5 +-
.../addon/search/match-highlighter.js | 2 +-
.../CodeMirror/addon/search/search.js | 48 +-
.../CodeMirror/addon/search/searchcursor.js | 31 +-
.../CodeMirror/addon/tern/tern.js | 39 +-
.../CodeMirror/addon/wrap/hardwrap.js | 5 +-
.../CodeMirror/demo/anywordhint.html | 24 +-
.../CodeMirror/demo/closetag.html | 1 +
.../CodeMirror/demo/complete.html | 4 +-
.../QNModManager/CodeMirror/demo/lint.html | 4 +-
.../CodeMirror/demo/matchhighlighter.html | 2 +-
.../CodeMirror/demo/mustache.html | 2 +-
.../CodeMirror/demo/simplemode.html | 2 +-
.../QNModManager/CodeMirror/demo/tern.html | 20 +-
.../QNModManager/CodeMirror/demo/theme.html | 4 +
.../QNModManager/CodeMirror/demo/vim.html | 12 +-
.../QNModManager/CodeMirror/doc/docs.css | 2 +-
.../CodeMirror/doc/internals.html | 2 +-
.../QNModManager/CodeMirror/doc/logos/4me.svg | 1 +
.../CodeMirror/doc/logos/anvil.png | Bin 0 -> 9512 bytes
.../CodeMirror/doc/logos/artcompiler.svg | 1 +
.../CodeMirror/doc/logos/cargo.svg | 1 +
.../CodeMirror/doc/logos/codepen.svg | 1 +
.../CodeMirror/doc/logos/desmos.svg | 1 +
.../CodeMirror/doc/logos/executeprogram.svg | 1 +
.../CodeMirror/doc/logos/holmusk.svg | 1 +
.../CodeMirror/doc/logos/jetbrains.svg | 1 +
.../CodeMirror/doc/logos/observable.svg | 1 +
.../CodeMirror/doc/logos/primo.svg | 1 +
.../CodeMirror/doc/logos/prisma.svg | 1 +
.../QNModManager/CodeMirror/doc/manual.html | 53 +-
.../CodeMirror/doc/realworld.html | 14 +-
.../QNModManager/CodeMirror/doc/releases.html | 200 ++-
.../CodeMirror/doc/source_sans.woff | Bin 0 -> 29448 bytes
.../CodeMirror/doc/upgrade_v2.2.html | 2 +-
.../utils/QNModManager/CodeMirror/index.html | 33 +-
.../QNModManager/CodeMirror/keymap/emacs.js | 394 ++++--
.../QNModManager/CodeMirror/keymap/sublime.js | 16 +-
.../QNModManager/CodeMirror/keymap/vim.js | 654 ++++++----
.../CodeMirror/lib/codemirror.css | 23 +-
.../QNModManager/CodeMirror/lib/codemirror.js | 201 ++-
.../CodeMirror/mode/asn.1/asn.1.js | 2 +-
.../CodeMirror/mode/clike/clike.js | 27 +-
.../CodeMirror/mode/clike/index.html | 2 +-
.../CodeMirror/mode/clojure/clojure.js | 4 +-
.../CodeMirror/mode/cobol/cobol.js | 2 +-
.../CodeMirror/mode/commonlisp/commonlisp.js | 1 +
.../CodeMirror/mode/crystal/crystal.js | 12 +-
.../QNModManager/CodeMirror/mode/css/css.js | 65 +-
.../CodeMirror/mode/css/index.html | 6 +
.../CodeMirror/mode/cypher/cypher.js | 5 +-
.../QNModManager/CodeMirror/mode/dtd/dtd.js | 4 +-
.../QNModManager/CodeMirror/mode/ebnf/ebnf.js | 14 +-
.../CodeMirror/mode/erlang/erlang.js | 4 +-
.../CodeMirror/mode/factor/factor.js | 4 +-
.../CodeMirror/mode/factor/index.html | 2 +-
.../CodeMirror/mode/fcl/index.html | 10 +-
.../CodeMirror/mode/forth/index.html | 2 +-
.../CodeMirror/mode/fortran/fortran.js | 2 +-
.../QNModManager/CodeMirror/mode/gas/gas.js | 12 +-
.../QNModManager/CodeMirror/mode/gfm/test.js | 2 +-
.../QNModManager/CodeMirror/mode/haml/haml.js | 2 +-
.../CodeMirror/mode/htmlembedded/index.html | 2 +-
.../CodeMirror/mode/htmlmixed/htmlmixed.js | 5 +-
.../QNModManager/CodeMirror/mode/idl/idl.js | 2 +-
.../QNModManager/CodeMirror/mode/index.html | 1 +
.../CodeMirror/mode/javascript/index.html | 6 +-
.../CodeMirror/mode/javascript/javascript.js | 56 +-
.../CodeMirror/mode/javascript/test.js | 8 +-
.../QNModManager/CodeMirror/mode/jsx/jsx.js | 2 +-
.../QNModManager/CodeMirror/mode/jsx/test.js | 7 +
.../CodeMirror/mode/julia/julia.js | 95 +-
.../QNModManager/CodeMirror/mode/lua/lua.js | 1 +
.../CodeMirror/mode/markdown/index.html | 10 +-
.../CodeMirror/mode/markdown/markdown.js | 8 +-
.../CodeMirror/mode/markdown/test.js | 4 +-
.../QNModManager/CodeMirror/mode/meta.js | 9 +-
.../CodeMirror/mode/mllike/mllike.js | 2 +-
.../CodeMirror/mode/modelica/modelica.js | 6 +-
.../CodeMirror/mode/mscgen/mscgen.js | 8 +-
.../CodeMirror/mode/mumps/mumps.js | 2 +-
.../CodeMirror/mode/nginx/index.html | 4 +-
.../QNModManager/CodeMirror/mode/nsis/nsis.js | 40 +-
.../CodeMirror/mode/ntriples/index.html | 2 +-
.../QNModManager/CodeMirror/mode/oz/oz.js | 4 +-
.../CodeMirror/mode/pegjs/pegjs.js | 6 +-
.../QNModManager/CodeMirror/mode/perl/perl.js | 13 +-
.../QNModManager/CodeMirror/mode/php/php.js | 12 +-
.../QNModManager/CodeMirror/mode/pug/pug.js | 2 +-
.../CodeMirror/mode/puppet/puppet.js | 2 +-
.../CodeMirror/mode/python/index.html | 2 +-
.../CodeMirror/mode/python/python.js | 25 +-
.../CodeMirror/mode/python/test.js | 32 +-
.../utils/QNModManager/CodeMirror/mode/r/r.js | 4 +-
.../QNModManager/CodeMirror/mode/rpm/rpm.js | 8 +-
.../CodeMirror/mode/ruby/index.html | 2 +-
.../QNModManager/CodeMirror/mode/ruby/ruby.js | 41 +-
.../QNModManager/CodeMirror/mode/sass/sass.js | 9 +-
.../CodeMirror/mode/scheme/scheme.js | 45 +-
.../CodeMirror/mode/shell/shell.js | 16 +
.../CodeMirror/mode/shell/test.js | 15 +-
.../CodeMirror/mode/sieve/sieve.js | 2 +-
.../QNModManager/CodeMirror/mode/soy/soy.js | 85 +-
.../QNModManager/CodeMirror/mode/soy/test.js | 38 +
.../CodeMirror/mode/sparql/sparql.js | 14 +-
.../QNModManager/CodeMirror/mode/sql/sql.js | 18 +-
.../CodeMirror/mode/stylus/stylus.js | 12 +-
.../CodeMirror/mode/tiddlywiki/tiddlywiki.js | 2 +-
.../CodeMirror/mode/vbscript/vbscript.js | 4 +-
.../CodeMirror/mode/velocity/velocity.js | 3 +-
.../CodeMirror/mode/verilog/test.js | 170 +++
.../CodeMirror/mode/verilog/verilog.js | 141 +-
.../CodeMirror/mode/vue/index.html | 2 +-
.../CodeMirror/mode/wast/index.html | 4 +-
.../QNModManager/CodeMirror/mode/wast/test.js | 173 ++-
.../QNModManager/CodeMirror/mode/wast/wast.js | 95 +-
.../QNModManager/CodeMirror/mode/xml/xml.js | 22 +-
.../mode/yaml-frontmatter/yaml-frontmatter.js | 30 +-
.../QNModManager/CodeMirror/mode/yaml/yaml.js | 8 +-
.../QNModManager/CodeMirror/package.json | 2 +-
.../addon/runmode/codemirror-standalone.js | 2 +
.../CodeMirror/src/display/Display.js | 4 +
.../CodeMirror/src/display/focus.js | 9 +-
.../CodeMirror/src/display/operations.js | 3 +-
.../CodeMirror/src/display/scroll_events.js | 18 +-
.../CodeMirror/src/display/scrollbars.js | 1 +
.../CodeMirror/src/display/scrolling.js | 9 +-
.../CodeMirror/src/display/selection.js | 21 +-
.../CodeMirror/src/display/update_display.js | 3 +
.../CodeMirror/src/display/update_line.js | 1 +
.../CodeMirror/src/display/update_lines.js | 6 +
.../CodeMirror/src/edit/CodeMirror.js | 6 +-
.../CodeMirror/src/edit/commands.js | 2 +-
.../QNModManager/CodeMirror/src/edit/main.js | 2 +-
.../CodeMirror/src/edit/methods.js | 28 +-
.../CodeMirror/src/edit/mouse_events.js | 11 +-
.../CodeMirror/src/edit/options.js | 2 +-
.../src/input/ContentEditableInput.js | 11 +-
.../CodeMirror/src/input/TextareaInput.js | 1 +
.../CodeMirror/src/input/input.js | 2 +-
.../CodeMirror/src/input/keymap.js | 7 +-
.../CodeMirror/src/line/line_data.js | 2 +-
.../QNModManager/CodeMirror/src/line/spans.js | 12 +-
.../src/measurement/position_measurement.js | 20 +-
.../QNModManager/CodeMirror/src/model/Doc.js | 7 +-
.../CodeMirror/src/model/document_data.js | 1 +
.../CodeMirror/src/model/history.js | 6 +-
.../CodeMirror/src/model/line_widget.js | 2 +-
.../CodeMirror/src/model/mark_text.js | 2 +-
.../CodeMirror/src/model/selection_updates.js | 2 +-
.../CodeMirror/src/util/browser.js | 2 +-
.../CodeMirror/test/emacs_test.js | 21 +-
.../QNModManager/CodeMirror/test/lint.js | 3 +-
.../QNModManager/CodeMirror/test/test.js | 8 +-
.../QNModManager/CodeMirror/test/vim_test.js | 1160 ++++++++++-------
.../QNModManager/CodeMirror/theme/abbott.css | 268 ++++
.../CodeMirror/theme/ayu-dark.css | 2 +
.../CodeMirror/theme/ayu-mirage.css | 4 +-
.../CodeMirror/theme/base16-dark.css | 2 +
.../CodeMirror/theme/gruvbox-dark.css | 2 +
.../QNModManager/CodeMirror/theme/juejin.css | 30 +
.../CodeMirror/theme/material-ocean.css | 8 +-
.../CodeMirror/theme/material-palenight.css | 8 +-
.../CodeMirror/theme/material.css | 8 +-
.../CodeMirror/theme/oceanic-next.css | 2 +
.../CodeMirror/theme/solarized.css | 5 +-
.../JS Loader/root/config.js | 26 +-
.../root/defaults/pref/config-prefs.js | 2 +-
.../JS Loader/utils/boot.jsm | 14 -
.../JS Loader/utils/userChrome.jsm | 86 +-
.../JS Loader/utils/xPref.jsm | 2 +-
.../MultiRowTab-scrollable-autohide.uc.js | 13 +-
.../MultiRowTab-scrollable.uc.js | 38 +-
.../Multirow tabs/MultiRowTabLiteforFx.uc.js | 13 +-
README.md | 10 +-
210 files changed, 4425 insertions(+), 1834 deletions(-)
delete mode 100644 Installers/Multirow & other functions/utils/boot.jsm
delete mode 100644 Mod manager/utils/QNModManager/CodeMirror/.travis.yml
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/4me.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/anvil.png
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/artcompiler.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/cargo.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/codepen.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/desmos.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/executeprogram.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/holmusk.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/jetbrains.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/observable.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/primo.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/logos/prisma.svg
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/doc/source_sans.woff
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/theme/abbott.css
create mode 100644 Mod manager/utils/QNModManager/CodeMirror/theme/juejin.css
delete mode 100644 Multirow and other functions/JS Loader/utils/boot.jsm
diff --git a/Installers/Multirow & other functions/functions/MultiRowTab-scrollable-autohide.uc.js b/Installers/Multirow & other functions/functions/MultiRowTab-scrollable-autohide.uc.js
index 6fe7bdc6..1ecb9b2c 100644
--- a/Installers/Multirow & other functions/functions/MultiRowTab-scrollable-autohide.uc.js
+++ b/Installers/Multirow & other functions/functions/MultiRowTab-scrollable-autohide.uc.js
@@ -3,8 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with autohiding scrollbar
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 22/01/2022 16:50 Tab sizing fixes
// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
@@ -136,9 +137,13 @@ function zzzz_MultiRowTabLite() {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
+ }
+
+ .titlebar-buttonbox-container {
+ display: block !important;
}
*/
diff --git a/Installers/Multirow & other functions/functions/MultiRowTab-scrollable.uc.js b/Installers/Multirow & other functions/functions/MultiRowTab-scrollable.uc.js
index 6506fa30..f1af9fc7 100644
--- a/Installers/Multirow & other functions/functions/MultiRowTab-scrollable.uc.js
+++ b/Installers/Multirow & other functions/functions/MultiRowTab-scrollable.uc.js
@@ -3,10 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with scrollable rows
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
-// @version 22/01/2022 16:50 Tab sizing fixes
-// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
// @version 10/09/2021 09:49 Fixed regression of pinned tabs icon showing unaligned
// @version 19/08/2021 03:15 Compatibility fix for FF91
@@ -122,36 +121,27 @@ function zzzz_MultiRowTabLite() {
}
/* These below control the padding of the new tab button and min/max/close buttons respectively.
- YOU DON'T NEED TO CHANGE THESE unless you want to use values of --tab-min-height lower than 20px.
- Before changing them, you need to UNCOMMENT the 2 rules below for them TO TAKE EFFECT.
-
- The first rule (#TabsToolbar) controls the padding around the "new tab" button. Make sure to always use "px"
- as unit for it to work, even on 0 value. Reducing it will allow a lower limit on the tabs height.
-
- The second rule (.titlebar-buttonbox) has paddings control the padding of the min/max/close buttons.
- Changing these are required if you want the tab bar to be smaller when having 1 row. */
+ YOU DON'T NEED TO CHANGE THESE unless you want to use values of --tab-min-height lower than 20px.
+ Before changing them, you need to UNCOMMENT the 2 rules below for them TO TAKE EFFECT. */
/*
#TabsToolbar {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
}
- */
-
- /*-------- Don't edit past here unless you know what you are doing --------*/
- /* These 2 rules are a fix to make sure that tabs become smaller on smaller --tab-min-height values */
- .tabbrowser-tab {
- max-height: calc(var(--tab-min-height) + var(--toolbarbutton-inner-padding)) !important;
+ .titlebar-buttonbox-container {
+ display: block !important;
}
- .toolbar-items {-moz-box-align: start !important}
+ */
+
+ /*-------- Don't edit past here unless you know what you are doing --------*/
- /* Common multirow code */
#navigator-toolbox:-moz-lwtheme {
background-color: var(--toolbar-bgcolor) !important;
}
@@ -192,7 +182,7 @@ function zzzz_MultiRowTabLite() {
/* A fix for pinned tabs triggering another row when only pinned tabs are shown in a row */
.tabbrowser-tab[pinned] {
- max-height: calc(var(--tab-min-height) + 8px);
+ height: calc(var(--tab-min-height) + 8px) !important;
}
/* This fixes the new tab button overflowing to the new row alone */
@@ -243,6 +233,8 @@ function zzzz_MultiRowTabLite() {
tabsHavePadding = true;
}
+ console.log(getComputedStyle(tabBackground).getPropertyValue('--tab-block-margin').substring(0,1))
+
// Here the FF71+ changes
if (document.querySelector("#tabbrowser-tabs > arrowscrollbox").shadowRoot) {
@@ -281,7 +273,7 @@ function zzzz_MultiRowTabLite() {
`;
// This is a fix for FF89+ (Proton)
- if (document.documentElement.hasAttribute("proton") || tabsHavePadding) {
+ if (tabsHavePadding) {
style.innerHTML += `
scrollbox {
max-height: calc((var(--tab-min-height) + 8px) * var(--max-tab-rows));
diff --git a/Installers/Multirow & other functions/functions/MultiRowTabLiteforFx.uc.js b/Installers/Multirow & other functions/functions/MultiRowTabLiteforFx.uc.js
index 482ddf1f..c43c1b7e 100644
--- a/Installers/Multirow & other functions/functions/MultiRowTabLiteforFx.uc.js
+++ b/Installers/Multirow & other functions/functions/MultiRowTabLiteforFx.uc.js
@@ -3,8 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with unlimited rows
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 22/01/2022 16:50 Tab sizing fixes
// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
@@ -109,9 +110,13 @@ function zzzz_MultiRowTabLite() {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
+ }
+
+ .titlebar-buttonbox-container {
+ display: block !important;
}
*/
diff --git a/Installers/Multirow & other functions/root/config.js b/Installers/Multirow & other functions/root/config.js
index 4980e5e1..69a2072e 100644
--- a/Installers/Multirow & other functions/root/config.js
+++ b/Installers/Multirow & other functions/root/config.js
@@ -1,8 +1,26 @@
// skip 1st line
+lockPref('xpinstall.signatures.required', false);
+
+Object = Cu.getGlobalForObject(Cu).Object;
+const { freeze } = Object;
+Object.freeze = obj => {
+ if (Components.stack.caller.filename != 'resource://gre/modules/AppConstants.jsm')
+ return freeze(obj);
+
+ obj.MOZ_REQUIRE_SIGNING = false;
+ Object.freeze = freeze;
+ return freeze(obj);
+}
+
try {
-
- let Cu = Components.utils;
- Cu.import('resource://gre/modules/osfile.jsm');
- Cu.import(OS.Path.toFileURI(OS.Constants.Path.profileDir)+ '/chrome/utils/boot.jsm');
+ let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
+ cmanifest.append('utils');
+ cmanifest.append('chrome.manifest');
+ Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
-} catch(ex) {};
+ Cu.import('chrome://userchromejs/content/BootstrapLoader.jsm');
+} catch (ex) {};
+
+try {
+ Cu.import('chrome://userchromejs/content/userChrome.jsm');
+} catch (ex) {};
\ No newline at end of file
diff --git a/Installers/Multirow & other functions/root/defaults/pref/config-prefs.js b/Installers/Multirow & other functions/root/defaults/pref/config-prefs.js
index 57e8af3e..65ff8afe 100644
--- a/Installers/Multirow & other functions/root/defaults/pref/config-prefs.js
+++ b/Installers/Multirow & other functions/root/defaults/pref/config-prefs.js
@@ -1,3 +1,3 @@
pref("general.config.obscure_value", 0);
pref("general.config.filename", "config.js");
-pref("general.config.sandbox_enabled", false);
+pref("general.config.sandbox_enabled", false);
\ No newline at end of file
diff --git a/Installers/Multirow & other functions/utils/boot.jsm b/Installers/Multirow & other functions/utils/boot.jsm
deleted file mode 100644
index e5516153..00000000
--- a/Installers/Multirow & other functions/utils/boot.jsm
+++ /dev/null
@@ -1,14 +0,0 @@
-let EXPORTED_SYMBOLS = [];
-
-let {
- classes: Cc,
- interfaces: Ci,
- manager: Cm
-} = Components;
-
-var cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
-cmanifest.append('utils');
-cmanifest.append('chrome.manifest');
-Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
-
-ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
diff --git a/Installers/Multirow & other functions/utils/userChrome.jsm b/Installers/Multirow & other functions/utils/userChrome.jsm
index 84ec226f..fde9f490 100644
--- a/Installers/Multirow & other functions/utils/userChrome.jsm
+++ b/Installers/Multirow & other functions/utils/userChrome.jsm
@@ -1,18 +1,26 @@
let EXPORTED_SYMBOLS = [];
-const {Services} = ChromeUtils.import('resource://gre/modules/Services.jsm');
-const {xPref} = ChromeUtils.import('chrome://userchromejs/content/xPref.jsm');
-
-let UC = {};
+const { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm');
+const { xPref } = ChromeUtils.import('chrome://userchromejs/content/xPref.jsm');
+const { Management } = ChromeUtils.import('resource://gre/modules/Extension.jsm');
+const { AppConstants } = ChromeUtils.import('resource://gre/modules/AppConstants.jsm');
+
+let UC = {
+ webExts: new Map(),
+ sidebar: new Map()
+};
let _uc = {
ALWAYSEXECUTE: 'userChrome.uc.js',
- BROWSERCHROME: 'chrome://browser/content/browser.xhtml',
+ BROWSERCHROME: AppConstants.MOZ_APP_NAME == 'thunderbird' ? 'chrome://messenger/content/messenger.xhtml' : 'chrome://browser/content/browser.xhtml',
+ BROWSERTYPE: AppConstants.MOZ_APP_NAME == 'thunderbird' ? 'mail:3pane' : 'navigator:browser',
+ BROWSERNAME: AppConstants.MOZ_APP_NAME.charAt(0).toUpperCase() + AppConstants.MOZ_APP_NAME.slice(1),
PREF_ENABLED: 'userChromeJS.enabled',
PREF_SCRIPTSDISABLED: 'userChromeJS.scriptsDisabled',
- BASE_FILEURI: Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler).getURLSpecFromDir(Services.dirsvc.get('UChrm', Ci.nsIFile)),
chromedir: Services.dirsvc.get('UChrm', Ci.nsIFile),
+ scriptsDir: '',
+
sss: Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService),
getScripts: function () {
@@ -24,8 +32,7 @@ let _uc = {
let fileURI = Services.io.newFileURI(file);
if (/\.uc\.js$/i.test(file.leafName)) {
_uc.getScriptData(file);
- }
- else if(/\.as\.css$/i.test(file.leafName)) {
+ } else if(/\.as\.css$/i.test(file.leafName)) {
if(!sss.sheetRegistered(fileURI, sss.AGENT_SHEET))
sss.loadAndRegisterSheet(fileURI, sss.AGENT_SHEET);
}
@@ -55,9 +62,8 @@ let _uc = {
return this.scripts[filename] = {
filename: filename,
file: aFile,
- url: this.BASE_FILEURI + filename,
+ url: Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler).getURLSpecFromDir(this.chromedir) + filename,
name: (header.match(/\/\/ @name\s+(.+)\s*$/im) || def)[1],
- charset: (header.match(/\/\/ @charset\s+(.+)\s*$/im) || def)[1],
description: (header.match(/\/\/ @description\s+(.+)\s*$/im) || def)[1],
version: (header.match(/\/\/ @version\s+(.+)\s*$/im) || def)[1],
author: (header.match(/\/\/ @author\s+(.+)\s*$/im) || def)[1],
@@ -109,11 +115,8 @@ let _uc = {
}
try {
- if (script.charset) {
- Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime, win, script.charset);
- } else {
- Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime, win, 'UTF-8');
- }
+ Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime,
+ script.onlyonce ? { window: win } : win);
script.isRunning = true;
if (script.startup) {
eval(script.startup);
@@ -122,12 +125,12 @@ let _uc = {
this.everLoaded.push(script.id);
}
} catch (ex) {
- this.error(script.filename, ex);
+ Cu.reportError(ex);
}
},
windows: function (fun, onlyBrowsers = true) {
- let windows = Services.wm.getEnumerator(onlyBrowsers ? 'navigator:browser' : null);
+ let windows = Services.wm.getEnumerator(onlyBrowsers ? this.BROWSERTYPE : null);
while (windows.hasMoreElements()) {
let win = windows.getNext();
if (!win._uc)
@@ -156,16 +159,6 @@ let _uc = {
el.setAttribute(att, atts[att]);
}
return el
- },
-
- error: function (aMsg, err) {
- let error = Cc['@mozilla.org/scripterror;1'].createInstance(Ci.nsIScriptError);
- if (typeof err == 'object') {
- error.init(aMsg + '\n' + err.name + ' : ' + err.message, err.fileName || null, null, err.lineNumber, null, 2, err.name);
- } else {
- error.init(aMsg + '\n' + err + '\n', null, null, null, null, 2, null);
- }
- Services.console.logMessage(error);
}
};
@@ -177,12 +170,7 @@ if (xPref.get(_uc.PREF_SCRIPTSDISABLED) === undefined) {
xPref.set(_uc.PREF_SCRIPTSDISABLED, '', true);
}
-function UserChrome_js() {
- _uc.getScripts();
- Services.obs.addObserver(this, 'chrome-document-global-created', false);
-}
-
-UserChrome_js.prototype = {
+let UserChrome_js = {
observe: function (aSubject) {
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
},
@@ -191,7 +179,14 @@ UserChrome_js.prototype = {
let document = aEvent.originalTarget;
let window = document.defaultView;
let location = window.location;
- if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
+
+ if (!this.sharedWindowOpened && location.href == 'chrome://extensions/content/dummy.xhtml') {
+ this.sharedWindowOpened = true;
+
+ Management.on('extension-browser-inserted', function (topic, browser) {
+ browser.messageManager.addMessageListener('Extension:ExtensionViewLoaded', this.messageListener.bind(this));
+ }.bind(this));
+ } else if (/^(chrome:(?!\/\/global\/content\/commonDialog\.x?html)|about:(?!blank))/i.test(location.href)) {
window.UC = UC;
window._uc = _uc;
window.xPref = xPref;
@@ -206,8 +201,27 @@ UserChrome_js.prototype = {
_uc.loadScript(_uc.scripts[_uc.ALWAYSEXECUTE], window);
}
}
+ },
+
+ messageListener: function (msg) {
+ const browser = msg.target;
+ const { addonId } = browser._contentPrincipal;
+
+ browser.messageManager.removeMessageListener('Extension:ExtensionViewLoaded', this.messageListener);
+
+ if (browser.ownerGlobal.location.href == 'chrome://extensions/content/dummy.xhtml') {
+ UC.webExts.set(addonId, browser);
+ Services.obs.notifyObservers(null, 'UCJS:WebExtLoaded', addonId);
+ } else {
+ let win = browser.ownerGlobal.windowRoot.ownerGlobal;
+ UC.sidebar.get(addonId)?.set(win, browser) || UC.sidebar.set(addonId, new Map([[win, browser]]));
+ Services.obs.notifyObservers(win, 'UCJS:SidebarLoaded', addonId);
+ }
}
};
-if (!Services.appinfo.inSafeMode)
- new UserChrome_js();
+if (!Services.appinfo.inSafeMode) {
+ _uc.chromedir.append(_uc.scriptsDir);
+ _uc.getScripts();
+ Services.obs.addObserver(UserChrome_js, 'chrome-document-global-created', false);
+}
diff --git a/Installers/Multirow & other functions/utils/xPref.jsm b/Installers/Multirow & other functions/utils/xPref.jsm
index 4bd35665..df07b7ba 100644
--- a/Installers/Multirow & other functions/utils/xPref.jsm
+++ b/Installers/Multirow & other functions/utils/xPref.jsm
@@ -38,7 +38,7 @@ var xPref = {
switch (typeof value) {
case 'string':
- return sPrefs.setCharPref(prefPath, value) || value;
+ return sPrefs.setStringPref(prefPath, value) || value;
case 'number':
return sPrefs.setIntPref(prefPath, value) || value;
case 'boolean':
diff --git a/Mod manager/utils/QNModManager/CodeMirror/.travis.yml b/Mod manager/utils/QNModManager/CodeMirror/.travis.yml
deleted file mode 100644
index 1dfeb819..00000000
--- a/Mod manager/utils/QNModManager/CodeMirror/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - stable
-sudo: false
-cache: npm
diff --git a/Mod manager/utils/QNModManager/CodeMirror/AUTHORS b/Mod manager/utils/QNModManager/CodeMirror/AUTHORS
index 3fa6199e..5ab9613a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/AUTHORS
+++ b/Mod manager/utils/QNModManager/CodeMirror/AUTHORS
@@ -10,15 +10,18 @@ Abhishek Gahlot
Adam Ahmed
Adam King
Adam Particka
+Adam Wight
adanlobato
Adán Lobato
Aditya Toshniwal
Adrian Aichner
Adrian Heine
+Adrian Kunz
Adrien Bertrand
aeroson
Ahmad Amireh
Ahmad M. Zawawi
+AHOHNMYC
ahoward
Ajin Abraham
Akeksandr Motsjonov
@@ -27,6 +30,7 @@ AlbertHilb
Alberto González Palomo
Alberto Pose
Albert Xing
+Alexander Marks
Alexander Pavlov
Alexander Schepanovski
Alexander Shvets
@@ -35,6 +39,7 @@ Alexandre Bique
Alex Churchill
alexey-k
Alex Piggott
+Alf Eaton
Aliaksei Chapyzhenka
Allen Sarkisyan
Ami Fischman
@@ -73,8 +78,10 @@ Anthony Dugois
anthonygego
Anthony Gégo
Anthony Grimes
+Anthony Stewart
Anton Kovalyov
antosarho
+aoki ken
Apollo Zhu
AQNOUCH Mohammed
Aram Shatakhtsyan
@@ -112,6 +119,7 @@ Bernhard Sirlinger
Bert Chang
Bharad
BigBlueHat
+Billiam
Billy Moon
Bin Ni
binny
@@ -161,6 +169,7 @@ Chris Smith
Christian Gruen
Christian Oyarzun
Christian Petrov
+Christian Sonne
christopherblaser
Christopher Brown
Christopher Kramer
@@ -176,6 +185,7 @@ CodeBitt
coderaiser
Cole R Lawrence
ComFreek
+Cornelius Weig
Cristian Prieto
Curran Kelleher
Curtis Gagliardi
@@ -207,6 +217,7 @@ David Barnett
David H. Bronke
David Mignot
David Pathakjee
+David R. Myers
David Rodrigues
David Santana
David Vázquez
@@ -220,6 +231,7 @@ Dick Choi
Diego Fernandez
dignifiedquire
Dimage Sapelkin
+Dimitri Mitropoulos
Dinindu D. Wanniarachchi
dmaclach
Dmitry Kiselyov
@@ -242,6 +254,7 @@ edoroshenko
edsharp
ekhaled
Elisée
+Elmar Peise
elpnt
Emmanuel Schanzer
Enam Mijbah Noor
@@ -249,6 +262,7 @@ Eric Allam
Eric Bogard
Erik Demaine
Erik Welander
+erosman
eustas
Evan Minsk
Fabien Dubosson
@@ -259,6 +273,7 @@ Fauntleroy
fbuchinger
feizhang365
Felipe Lalanne
+Felipe S. S. Schneider
Felix Raab
ficristo
Filip Noetzel
@@ -285,6 +300,7 @@ galambalazs
Gary Sheng
Gautam Mehta
Gavin Douglas
+Geist-zz
gekkoe
Geordie Hall
George Stephanis
@@ -324,6 +340,7 @@ Heanes
Hector Oswaldo Caballero
Hein Htat
Hélio
+Hendrik Erz
Hendrik Wallbaum
Henrik Haugbølle
Herculano Campos
@@ -332,10 +349,12 @@ Hiroyuki Makino
hitsthings
Hocdoc
Howard
+Howard Jing
Hugues Malphettes
Ian Beck
Ian Davies
Ian Dickinson
+Ian Henderson
ianhi
Ian Rose
Ian Wehrman
@@ -348,16 +367,23 @@ ilvalle
Ilya Kharlamov
Ilya Zverev
Ingo Richter
+Intervue
Irakli Gozalishvili
+iteriani
Ivan Kurnosov
Ivoah
Jack Douglas
Jacob Lee
Jaimin
Jake Peyser
+Jake Zimmerman
+Jakob Kummerow
Jakob Miland
+Jakub Nowak
+Jakub T. Jankiewicz
Jakub Vrana
Jakub Vrána
+James Baicoianu
James Campos
James Cockshull
James Howard
@@ -400,6 +426,7 @@ jochenberger
Jochen Berger
Joel Einbinder
joelpinheiro
+Joe Predham
joewalsh
Johan Ask
Johannes
@@ -410,6 +437,7 @@ John Engler
John Lees-Miller
John Ryan
John Snelson
+johnspiegel
John Van Der Loo
Jon Ander Peñalba
Jonas Döbertin
@@ -417,12 +445,14 @@ Jonas Helfer
Jonathan Dierksen
Jonathan Hart
Jonathan Malmaud
+Jonathan Rascher
Jon Gacnik
jongalloway
Jon Malmaud
Jon Sangster
Joo
Joost-Wim Boekesteijn
+José dBruxelles
Joseph Pecoraro
Josh Barnes
Josh Cohen
@@ -446,9 +476,11 @@ karevn
Karol
Kaushik Kulkarni
Kayur Patel
+Kazuhisa Ishizaka
Kazuhito Hokamura
kcwiakala
Kees de Kooter
+Keldan Chapman
Kenan Christian Dimas
Ken Newman
ken restivo
@@ -459,9 +491,11 @@ Kevin Muret
Kevin Sawicki
Kevin Ushey
Kier Darby
+Kim-Anh Tran
Klaus Silveira
Koh Zi Han, Cliff
komakino
+Konstantin Chernenko
Konstantin Lopuhin
koops
Kris Ciccarello
@@ -483,10 +517,12 @@ Leo Baschy
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
+lexer2086
Liam Newman
Libo Cannici
Lior Goldberg
Lior Shub
+lishid
LloydMilligan
LM
lochel
@@ -499,6 +535,7 @@ Lucas Buchala
Luciano Longo
Luciano Santana
Lu Fangjian
+Łukasz Wielgus
Luke Browning
Luke Granger-Brown
Luke Stagner
@@ -513,6 +550,7 @@ Manuel Rego Casasnovas
Marat Dreizin
Marcel Gerber
Marcelo Camargo
+Marc Espín
Marco Aurélio
Marco Munizaga
Marcus Bointon
@@ -521,6 +559,7 @@ Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Anderson
+Mark Boyes
Mark Dalgleish
Mark Hamstra
Mark Lentczner
@@ -534,10 +573,12 @@ Martin Hasoň
Martin Hunt
Martin Laine
Martin Zagora
+Masahiro MATAYOSHI
Mason Malone
Mateusz Paprocki
Mathias Bynens
mats cronqvist
+Matt Diehl
Matt Gaide
Matthew Bauer
Matthew Beale
@@ -568,6 +609,7 @@ meshuamam
Metatheos
Micah Dubinko
Michael
+Michael Chirico
Michael Goderbauer
Michael Grey
Michael Kaminsky
@@ -590,11 +632,13 @@ Mike Ivanov
Mike Kadin
Mike Kobit
Milan Szekely
+MinJune Kim
MinRK
Miraculix87
misfo
mkaminsky11
mloginov
+mlsad3
Moritz Schubotz (physikerwelt)
Moritz Schwörer
Moshe Wajnberg
@@ -603,8 +647,10 @@ ms
mtaran-google
Mu-An ✌️ Chiou
Mu-An Chiou
+Mykola Martynovets
mzabuawala
Narciso Jaramillo
+nathanlesage
Nathan Williams
ndr
Neil Anderson
@@ -631,6 +677,7 @@ Nikolaj Kappler
Nikolay Kostov
nilp0inter
Nils Knappmeier
+Nina Pypchenko
Nisarg Jhaveri
nlwillia
noragrossman
@@ -638,6 +685,7 @@ Norman Rzepka
Nouzbe
Oleksandr Yakovenko
Olivia Ytterbrink
+Ondřej Mirtes
Opender Singh
opl-
Oreoluwa Onatemowo
@@ -675,19 +723,23 @@ Peter Flynn
peterkroon
Peter Kroon
Peter László
+Phil DeJarnett
Philipp A
Philipp Markovics
Philip Stadermann
Pi Delport
Pierre Gerold
Pieter Ouwerkerk
+Piyush
Pontus Melke
prasanthj
Prasanth J
Prayag Verma
prendota
Prendota
+ps173
Qiang Li
+quiddity-wp
Radek Piórkowski
Rahul
Rahul Anand
@@ -717,9 +769,12 @@ Roberto Abdelkader Martínez Pérez
robertop23
Roberto Vidal
Robert Plummer
+Roman Frolov
Roman Janusz
+Rongjian Zhang
Rrandom
Rrrandom
+Ruslan Bekenev
Ruslan Osmanov
rvalavicius
Ryan Pangrle
@@ -727,6 +782,7 @@ Ryan Petrello
Ryan Prior
ryu-sato
sabaca
+Sachin Gupta
Sam Lee
Sam Rawlins
Samuel Ainsworth
@@ -748,6 +804,7 @@ Scott Aikin
Scott Feeney
Scott Goodhew
Seb35
+Sebastian Ślepowroński
Sebastian Wilzbach
Sebastian Zaha
Seren D
@@ -768,7 +825,9 @@ Siamak Mokhtari
Siddhartha Gunti
silverwind
Simon Edwards
+Simon Huber
sinkuu
+Slava Rozhnev
snasa
soliton4
sonson
@@ -778,6 +837,7 @@ srajanpaliwal
Stanislav Oaserele
stan-z
Stas Kobzar
+stasoid
Stefan Borsje
Steffen Beyer
Steffen Bruchmann
@@ -786,6 +846,7 @@ Stephane Moore
Stephen Lavelle
Steve Champagne
Steve Hoover
+Steven Yung
Steve O'Hara
stockiNail
stoskov
@@ -809,6 +870,7 @@ Thaddee Tyl
thanasis
TheHowl
themrmax
+Thiemo Kreuz
think
Thomas Brouard
Thomas Dvornik
@@ -818,6 +880,7 @@ Thomas Schmid
Tim Alby
Tim Baumann
Tim Gates
+Tim Nguyen
Timothy Farrell
Timothy Gu
Timothy Hatcher
@@ -835,6 +898,7 @@ Tom MacWright
Tom McLaughlin
Tony Jian
tophf
+Torben Bundt
Torgeir Thoresen
totalamd
Travis Heppe
@@ -863,7 +927,9 @@ Wes Cossick
Wesley Wiser
Weston Ruter
Will Binns-Smith
+Will Cassella
Will Dean
+Will Hernandez
William Desportes
William Jamieson
William Stein
@@ -873,6 +939,8 @@ wonderboyjon
Wu Cheng-Han
Xavier Mendez
Yang Guo
+Yash Singh
+Yash-Singh1
Yassin N. Hassan
YNH Webdev
yoongu
diff --git a/Mod manager/utils/QNModManager/CodeMirror/CHANGELOG.md b/Mod manager/utils/QNModManager/CodeMirror/CHANGELOG.md
index 8e651ec7..2ccf2926 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/CHANGELOG.md
+++ b/Mod manager/utils/QNModManager/CodeMirror/CHANGELOG.md
@@ -1,3 +1,253 @@
+## 5.65.2 (2022-02-21)
+
+### Bug fixes
+
+[clike mode](https://codemirror.net/mode/clike/): Recognize triple quoted string in Java.
+
+[cypher mode](https://codemirror.net/mode/cypher/index.html): Fix handling of punctuation.
+
+## 5.65.1 (2022-01-20)
+
+### Bug fixes
+
+Fix miscalculation of vertical positions in lines that have both line widgets and replaced newlines.
+
+## 5.65.0 (2021-12-20)
+
+### Bug fixes
+
+brace-folding addon: Fix broken folding on lines with both braces and square brackets.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Support g0, g$, g.
+
+## 5.64.0 (2021-11-20)
+
+### Bug fixes
+
+Fix a crash that occurred in some situations with replacing marks across line breaks.
+
+Make sure native scrollbars reset their position when hidden and re-shown.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Support C-u to delete back a line.
+
+## 5.63.3 (2021-10-11)
+
+### Bug fixes
+
+Prevent external styles from giving the hidden textarea a min-height.
+
+Remove a stray autosave file that was part of the previous release.
+
+## 5.63.1 (2021-09-29)
+
+### Bug fixes
+
+Fix an issue with mouse scrolling on Chrome 94 Windows, which made scrolling by wheel move unusably slow.
+
+## 5.63.0 (2021-09-20)
+
+### Bug fixes
+
+Fix scroll position jumping when scrolling a document with very different line heights.
+
+[xml mode](https://codemirror.net/mode/xml/): Look up HTML element behavior in a case-insensitive way.
+
+### New features
+
+[vim bindings](https://codemirror.net/demo/vim.html): Support guu for case-changing.
+
+## 5.62.3 (2021-08-20)
+
+### Bug fixes
+
+Give the editor a `translate=no` attribute to prevent automatic translation from modifying its content.
+
+Give vim-style cursors a width that matches the character after them.
+
+[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Make buttons keyboard-accessible.
+
+[emacs bindings](https://codemirror.net/demo/emacs.html): Fix by-page scrolling keybindings, which were accidentally inverted.
+
+## 5.62.2 (2021-07-21)
+
+### Bug fixes
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Fix a regression that broke several addon options.
+
+## 5.62.1 (2021-07-20)
+
+### Bug fixes
+
+[vim bindings](https://codemirror.net/demo/vim.html): Make matching of upper-case characters more Unicode-aware.
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Prevent options passed to the addon itself from being given to the linter.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Improve screen reader support.
+
+[search addon](https://codemirror.net/demo/search.html): Avoid using `innerHTML`.
+
+## 5.62.0 (2021-06-21)
+
+### Bug fixes
+
+Improve support for vim-style cursors in a number of themes.
+
+### New features
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Add support for highlighting lines with errors or warnings.
+
+## 5.61.1 (2021-05-20)
+
+### Bug fixes
+
+Fix a bug where changing the editor's document could confuse text-direction management.
+
+Fix a bug in horizontally scrolling the cursor into view.
+
+Optimize adding lots of marks in a single transaction.
+
+[simple mode addon](https://codemirror.net/demo/simplemode.html): Support regexps with a unicode flag.
+
+[javascript mode](https://codemirror.net/mode/javascript/index.html): Add support for TypeScript template string types, improve integration with JSX mode.
+
+## 5.61.0 (2021-04-20)
+
+### Bug fixes
+
+Improve support for being in a shadow DOM in contenteditable mode.
+
+Prevent line number from being read by screen readers.
+
+[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix a crash caused by a race condition.
+
+[javascript mode](https://codemirror.net/mode/javascript/): Improve scope tracking.
+
+### New features
+
+The library now emits an `"updateGutter"` event when the gutter width changes.
+
+[emacs bindings](https://codemirror.net/demo/emacs.html): Provide named commands for all bindings.
+
+## 5.60.0 (2021-03-20)
+
+### Bug fixes
+
+Fix autofocus feature in contenteditable mode.
+
+[simple mode addon](https://codemirror.net/demo/simplemode.html): Fix a null-dereference crash.
+
+[multiplex addon](https://codemirror.net/demo/multiplex.html): Make it possible to use `parseDelimiters` when both delimiters are the same.
+
+[julia mode](https://codemirror.net/mode/julia/): Fix a lockup bug.
+
+### New features
+
+`setSelections` now allows ranges to omit the `head` property when it is equal to `anchor`.
+
+[sublime bindings](https://codemirror.net/demo/sublime.html): Add support for reverse line sorting.
+
+## 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
+
+Fix an issue where some Chrome browsers were detected as iOS.
+
+## 5.59.0 (2020-12-20)
+
+### Bug fixes
+
+Fix platform detection on recent iPadOS.
+
+[lint addon](https://codemirror.net/doc/manual.html#addon_lint): Don't show duplicate messages for a given line.
+
+[clojure mode](https://codemirror.net/mode/clojure/index.html): Fix regexp that matched in exponential time for some inputs.
+
+[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): Improve handling of words that are longer than the line length.
+
+[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Fix leaked event handler on disabling the addon.
+
+### New features
+
+[search addon](https://codemirror.net/demo/search.html): Make it possible to configure the search addon to show the dialog at the bottom of the editor.
+
+## 5.58.3 (2020-11-19)
+
+### Bug fixes
+
+Suppress quick-firing of blur-focus events when dragging and clicking on Internet Explorer.
+
+Fix the `insertAt` option to `addLineWidget` to actually allow the widget to be placed after all widgets for the line.
+
+[soy mode](https://codemirror.net/mode/soy/): Support `@Attribute` and element composition.
+
+[shell mode](https://codemirror.net/mode/shell/): Support heredoc quoting.
+
+## 5.58.2 (2020-10-23)
+
+### Bug fixes
+
+Fix a bug where horizontally scrolling the cursor into view sometimes failed with a non-fixed gutter.
+
+[julia mode](https://codemirror.net/mode/julia/): Fix an infinite recursion bug.
+
+## 5.58.1 (2020-09-23)
+
+### Bug fixes
+
+[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Remove arrow function that ended up in the code.
+
+## 5.58.0 (2020-09-21)
+
+### Bug fixes
+
+Make backspace delete by code point, not glyph.
+
+Suppress flickering focus outline when clicking on scrollbars in Chrome.
+
+Fix a bug that prevented attributes added via `markText` from showing up unless the span also had some other styling.
+
+Suppress cut and paste context menu entries in readonly editors in Chrome.
+
+[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Update placeholder visibility during composition.
+
+### New features
+
+Make it less cumbersome to style new lint message types.
+
+[vim bindings](https://codemirror.net/demo/vim.html): Support black hole register, `gn` and `gN`
+
## 5.57.0 (2020-08-20)
### Bug fixes
@@ -164,7 +414,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.
@@ -420,7 +670,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.
@@ -808,7 +1058,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.
@@ -926,7 +1176,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 ``.
@@ -1261,7 +1511,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)
@@ -1748,7 +1998,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).
@@ -1762,7 +2012,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/Mod manager/utils/QNModManager/CodeMirror/README.md b/Mod manager/utils/QNModManager/CodeMirror/README.md
index 2a7b1f5e..39c24686 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/README.md
+++ b/Mod manager/utils/QNModManager/CodeMirror/README.md
@@ -1,8 +1,7 @@
# CodeMirror
-[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
+[![Build Status](https://github.com/codemirror/codemirror/workflows/main/badge.svg)](https://github.com/codemirror/codemirror/actions)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
-[![Join the chat at https://gitter.im/codemirror/CodeMirror](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/codemirror/CodeMirror)
CodeMirror is a versatile text editor implemented in JavaScript for
the browser. It is specialized for editing code, and comes with over
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/display/panel.js b/Mod manager/utils/QNModManager/CodeMirror/addon/display/panel.js
index 4c9f2c0f..29f7e0be 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/display/panel.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/display/panel.js
@@ -76,7 +76,7 @@
};
function initPanels(cm) {
- var wrap = cm.getWrapperElement();
+ var wrap = cm.getWrapperElement()
var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle;
var height = parseInt(style.height);
var info = cm.state.panels = {
@@ -84,9 +84,10 @@
panels: [],
wrapper: document.createElement("div")
};
+ var hasFocus = cm.hasFocus(), scrollPos = cm.getScrollInfo()
wrap.parentNode.insertBefore(info.wrapper, wrap);
- var hasFocus = cm.hasFocus();
info.wrapper.appendChild(wrap);
+ cm.scrollTo(scrollPos.left, scrollPos.top)
if (hasFocus) cm.focus();
cm._setSize = cm.setSize;
@@ -114,8 +115,11 @@
var info = cm.state.panels;
cm.state.panels = null;
- var wrap = cm.getWrapperElement();
+ var wrap = cm.getWrapperElement()
+ var hasFocus = cm.hasFocus(), scrollPos = cm.getScrollInfo()
info.wrapper.parentNode.replaceChild(wrap, info.wrapper);
+ cm.scrollTo(scrollPos.left, scrollPos.top)
+ if (hasFocus) cm.focus();
wrap.style.height = info.setHeight;
cm.setSize = cm._setSize;
cm.setSize();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/display/placeholder.js b/Mod manager/utils/QNModManager/CodeMirror/addon/display/placeholder.js
index 4eabe3d9..cfb8341d 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/display/placeholder.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/display/placeholder.js
@@ -15,11 +15,13 @@
cm.on("blur", onBlur);
cm.on("change", onChange);
cm.on("swapDoc", onChange);
+ CodeMirror.on(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose = function() { onComposition(cm) })
onChange(cm);
} else if (!val && prev) {
cm.off("blur", onBlur);
cm.off("change", onChange);
cm.off("swapDoc", onChange);
+ CodeMirror.off(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose)
clearPlaceholder(cm);
var wrapper = cm.getWrapperElement();
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
@@ -46,6 +48,19 @@
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
}
+ function onComposition(cm) {
+ setTimeout(function() {
+ var empty = false
+ if (cm.lineCount() == 1) {
+ var input = cm.getInputField()
+ empty = input.nodeName == "TEXTAREA" ? !cm.getLine(0).length
+ : !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
+ }
+ if (empty) setPlaceholder(cm)
+ else clearPlaceholder(cm)
+ }, 20)
+ }
+
function onBlur(cm) {
if (isEmpty(cm)) setPlaceholder(cm);
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closebrackets.js b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closebrackets.js
index 4415c393..593d4439 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closebrackets.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closebrackets.js
@@ -87,7 +87,7 @@
cm.operation(function() {
var linesep = cm.lineSeparator() || "\n";
cm.replaceSelection(linesep + linesep, null);
- cm.execCommand("goCharLeft");
+ moveSel(cm, -1)
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
var line = ranges[i].head.line;
@@ -97,6 +97,17 @@
});
}
+ function moveSel(cm, dir) {
+ var newRanges = [], ranges = cm.listSelections(), primary = 0
+ for (var i = 0; i < ranges.length; i++) {
+ var range = ranges[i]
+ if (range.head == cm.getCursor()) primary = i
+ 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)
+ }
+
function contractSelection(sel) {
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
@@ -153,10 +164,9 @@
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
cm.operation(function() {
if (type == "skip") {
- cm.execCommand("goCharRight");
+ moveSel(cm, 1)
} else if (type == "skipThree") {
- for (var i = 0; i < 3; i++)
- cm.execCommand("goCharRight");
+ moveSel(cm, 3)
} else if (type == "surround") {
var sels = cm.getSelections();
for (var i = 0; i < sels.length; i++)
@@ -169,10 +179,10 @@
} else if (type == "both") {
cm.replaceSelection(left + right, null);
cm.triggerElectric(left + right);
- cm.execCommand("goCharLeft");
+ moveSel(cm, -1)
} else if (type == "addFour") {
cm.replaceSelection(left + left + left + left, "before");
- cm.execCommand("goCharRight");
+ moveSel(cm, 1)
}
});
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closetag.js b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closetag.js
index 8689765e..7c22a50e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closetag.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/closetag.js
@@ -128,9 +128,10 @@
replacement = head + "style";
} else {
var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state)
- if (!context || (context.length && closingTagExists(cm, context, context[context.length - 1], pos)))
+ var top = context.length ? context[context.length - 1] : ""
+ if (!context || (context.length && closingTagExists(cm, context, top, pos)))
return CodeMirror.Pass;
- replacement = head + context[context.length - 1]
+ replacement = head + top
}
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
replacements[i] = replacement;
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/continuelist.js b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/continuelist.js
index 2e5625ad..d8b2e0e1 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/continuelist.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/continuelist.js
@@ -24,7 +24,7 @@
// If we're not in Markdown mode, fall back to normal newlineAndIndent
var eolState = cm.getStateAfter(pos.line);
var inner = CodeMirror.innerMode(cm.getMode(), eolState);
- if (inner.mode.name !== "markdown") {
+ if (inner.mode.name !== "markdown" && inner.mode.helperType !== "markdown") {
cm.execCommand("newlineAndIndent");
return;
} else {
@@ -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/Mod manager/utils/QNModManager/CodeMirror/addon/edit/matchbrackets.js b/Mod manager/utils/QNModManager/CodeMirror/addon/edit/matchbrackets.js
index 2c47e070..43dc8840 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/edit/matchbrackets.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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() {
@@ -117,25 +119,25 @@
});
}
- CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
- function clear(cm) {
- if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
- cm.state.matchBrackets.currentlyHighlighted();
- cm.state.matchBrackets.currentlyHighlighted = null;
- }
+ function clearHighlighted(cm) {
+ if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
+ cm.state.matchBrackets.currentlyHighlighted();
+ cm.state.matchBrackets.currentlyHighlighted = null;
}
+ }
+ CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets);
cm.off("focus", doMatchBrackets)
- cm.off("blur", clear)
- clear(cm);
+ cm.off("blur", clearHighlighted)
+ clearHighlighted(cm);
}
if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets);
cm.on("focus", doMatchBrackets)
- cm.on("blur", clear)
+ cm.on("blur", clearHighlighted)
}
});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/fold/brace-fold.js b/Mod manager/utils/QNModManager/CodeMirror/addon/fold/brace-fold.js
index 654d1fb6..28cb093f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/fold/brace-fold.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/fold/brace-fold.js
@@ -11,53 +11,67 @@
})(function(CodeMirror) {
"use strict";
-CodeMirror.registerHelper("fold", "brace", function(cm, start) {
- var line = start.line, lineText = cm.getLine(line);
- var tokenType;
+function bracketFolding(pairs) {
+ return function(cm, start) {
+ var line = start.line, lineText = cm.getLine(line);
- function findOpening(openCh) {
- for (var at = start.ch, pass = 0;;) {
- var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
- if (found == -1) {
- if (pass == 1) break;
- pass = 1;
- at = lineText.length;
- continue;
+ function findOpening(pair) {
+ var tokenType;
+ for (var at = start.ch, pass = 0;;) {
+ var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1);
+ if (found == -1) {
+ if (pass == 1) break;
+ pass = 1;
+ at = lineText.length;
+ continue;
+ }
+ if (pass == 1 && found < start.ch) break;
+ tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
+ if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType, pair: pair};
+ at = found - 1;
}
- if (pass == 1 && found < start.ch) break;
- tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
- if (!/^(comment|string)/.test(tokenType)) return found + 1;
- at = found - 1;
}
- }
-
- var startToken = "{", endToken = "}", startCh = findOpening("{");
- if (startCh == null) {
- startToken = "[", endToken = "]";
- startCh = findOpening("[");
- }
- 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;
- for (;;) {
- var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
- if (nextOpen < 0) nextOpen = text.length;
- if (nextClose < 0) nextClose = text.length;
- pos = Math.min(nextOpen, nextClose);
- if (pos == text.length) break;
- if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
- if (pos == nextOpen) ++count;
- else if (!--count) { end = i; endCh = pos; break outer; }
+ function findRange(found) {
+ var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh
+ outer: for (var i = line; i <= lastLine; ++i) {
+ var text = cm.getLine(i), pos = i == line ? startCh : 0;
+ for (;;) {
+ var nextOpen = text.indexOf(found.pair[0], pos), nextClose = text.indexOf(found.pair[1], pos);
+ if (nextOpen < 0) nextOpen = text.length;
+ if (nextClose < 0) nextClose = text.length;
+ pos = Math.min(nextOpen, nextClose);
+ if (pos == text.length) break;
+ if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) {
+ if (pos == nextOpen) ++count;
+ else if (!--count) { end = i; endCh = pos; break outer; }
+ }
+ ++pos;
+ }
}
- ++pos;
+
+ if (end == null || line == end) return null
+ return {from: CodeMirror.Pos(line, startCh),
+ to: CodeMirror.Pos(end, endCh)};
+ }
+
+ var found = []
+ for (var i = 0; i < pairs.length; i++) {
+ var open = findOpening(pairs[i])
+ if (open) found.push(open)
+ }
+ found.sort(function(a, b) { return a.ch - b.ch })
+ for (var i = 0; i < found.length; i++) {
+ var range = findRange(found[i])
+ if (range) return range
}
+ return null
}
- if (end == null || line == end) return;
- return {from: CodeMirror.Pos(line, startCh),
- to: CodeMirror.Pos(end, endCh)};
-});
+}
+
+CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]]));
+
+CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]]));
CodeMirror.registerHelper("fold", "import", function(cm, start) {
function hasImport(line) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/fold/foldcode.js b/Mod manager/utils/QNModManager/CodeMirror/addon/fold/foldcode.js
index 887df3fe..721bc087 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/fold/foldcode.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/fold/foldcode.js
@@ -24,9 +24,11 @@
function getRange(allowFolded) {
var range = finder(cm, pos);
if (!range || range.to.line - range.from.line < minSize) return null;
+ if (force === "fold") return range;
+
var marks = cm.findMarksAt(range.from);
for (var i = 0; i < marks.length; ++i) {
- if (marks[i].__isFold && force !== "fold") {
+ if (marks[i].__isFold) {
if (!allowFolded) return null;
range.cleared = true;
marks[i].clear();
@@ -99,18 +101,18 @@
cm.foldCode(cm.getCursor(), null, "fold");
};
CodeMirror.commands.unfold = function(cm) {
- cm.foldCode(cm.getCursor(), null, "unfold");
+ cm.foldCode(cm.getCursor(), { scanUp: false }, "unfold");
};
CodeMirror.commands.foldAll = function(cm) {
cm.operation(function() {
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
- cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "fold");
});
};
CodeMirror.commands.unfoldAll = function(cm) {
cm.operation(function() {
for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
- cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "unfold");
});
};
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/html-hint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/html-hint.js
index d0cca4f6..9878eca6 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/html-hint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/html-hint.js
@@ -98,6 +98,7 @@
dfn: s,
dir: s,
div: s,
+ dialog: { attrs: { open: null } },
dl: s,
dt: s,
em: s,
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/javascript-hint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/javascript-hint.js
index 6d09e6b4..9f06b1b5 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/javascript-hint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/addon/hint/show-hint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/show-hint.js
index cd0d6a7b..2be2c716 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/show-hint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/show-hint.js
@@ -1,6 +1,8 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
+// declare global: DOMRect
+
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
@@ -59,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) {
@@ -73,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();
@@ -94,8 +100,10 @@
completion.to || data.to, "complete");
CodeMirror.signal(data, "pick", completion);
self.cm.scrollIntoView();
- })
- this.close();
+ });
+ if (this.options.closeOnPick) {
+ this.close();
+ }
},
cursorActivity: function() {
@@ -216,6 +224,7 @@
}
function Widget(completion, data) {
+ this.id = "cm-complete-" + Math.floor(Math.random(1e6))
this.completion = completion;
this.data = data;
this.picked = false;
@@ -224,6 +233,9 @@
var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;
var hints = this.hints = ownerDocument.createElement("ul");
+ hints.setAttribute("role", "listbox")
+ hints.setAttribute("aria-expanded", "true")
+ hints.id = this.id
var theme = completion.cm.options.theme;
hints.className = "CodeMirror-hints " + theme;
this.selectedHint = data.selectedHint || 0;
@@ -234,6 +246,9 @@
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
+ if (i == this.selectedHint) elt.setAttribute("aria-selected", "true")
+ elt.id = this.id + "-" + i
+ elt.setAttribute("role", "option")
if (cur.render) cur.render(elt, data, cur);
else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
@@ -259,10 +274,18 @@
var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);
var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);
container.appendChild(hints);
- var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
- var scrolls = hints.scrollHeight > hints.clientHeight + 1
- var startScroll = cm.getScrollInfo();
+ cm.getInputField().setAttribute("aria-autocomplete", "list")
+ cm.getInputField().setAttribute("aria-owns", this.id)
+ cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint)
+
+ var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();
+ var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;
+
+ // Compute in the timeout to avoid reflow on init
+ var startScroll;
+ setTimeout(function() { startScroll = cm.getScrollInfo(); });
+ var overlapY = box.bottom - winH;
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
@@ -280,6 +303,7 @@
}
}
var overlapX = box.right - winW;
+ if (scrolls) overlapX += cm.display.nativeBarWidth;
if (overlapX > 0) {
if (box.right - box.left > winW) {
hints.style.width = (winW - 5) + "px";
@@ -308,6 +332,7 @@
cm.on("scroll", this.onScroll = function() {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
+ if (!startScroll) startScroll = cm.getScrollInfo();
var newTop = top + startScroll.top - curScroll.top;
var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);
if (!below) point += hints.offsetHeight;
@@ -332,7 +357,12 @@
CodeMirror.on(hints, "mousedown", function() {
setTimeout(function(){cm.focus();}, 20);
});
- this.scrollToActive()
+
+ // The first hint doesn't need to be scrolled to on init
+ var selectedHintRange = this.getSelectedHintRange();
+ if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {
+ this.scrollToActive();
+ }
CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]);
return true;
@@ -342,8 +372,11 @@
close: function() {
if (this.completion.widget != this) return;
this.completion.widget = null;
- this.hints.parentNode.removeChild(this.hints);
+ if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
+ var input = this.completion.cm.getInputField()
+ input.removeAttribute("aria-activedescendant")
+ input.removeAttribute("aria-owns")
var cm = this.completion.cm;
if (this.completion.options.closeOnUnfocus) {
@@ -371,17 +404,22 @@
i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
- if (node) node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
+ if (node) {
+ node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
+ node.removeAttribute("aria-selected")
+ }
node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
+ node.setAttribute("aria-selected", "true")
+ this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id)
this.scrollToActive()
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
scrollToActive: function() {
- var margin = this.completion.options.scrollMargin || 0;
- var node1 = this.hints.childNodes[Math.max(0, this.selectedHint - margin)];
- var node2 = this.hints.childNodes[Math.min(this.data.list.length - 1, this.selectedHint + margin)];
+ var selectedHintRange = this.getSelectedHintRange();
+ var node1 = this.hints.childNodes[selectedHintRange.from];
+ var node2 = this.hints.childNodes[selectedHintRange.to];
var firstNode = this.hints.firstChild;
if (node1.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;
@@ -391,6 +429,14 @@
screenAmount: function() {
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
+ },
+
+ getSelectedHintRange: function() {
+ var margin = this.completion.options.scrollMargin || 0;
+ return {
+ from: Math.max(0, this.selectedHint - margin),
+ to: Math.min(this.data.list.length - 1, this.selectedHint + margin),
+ };
}
};
@@ -468,11 +514,15 @@
completeSingle: true,
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
+ closeOnPick: true,
closeOnUnfocus: true,
+ updateOnCursorActivity: true,
completeOnSingleClick: true,
container: null,
customKeys: null,
- extraKeys: null
+ extraKeys: null,
+ paddingForScrollbar: true,
+ moveOnOverlap: true,
};
CodeMirror.defineOption("hintOptions", null);
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/sql-hint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/sql-hint.js
index de84707d..efdce813 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/sql-hint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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(".");
@@ -187,7 +187,7 @@
function eachWord(lineText, f) {
var words = lineText.split(/\s+/)
for (var i = 0; i < words.length; i++)
- if (words[i]) f(words[i].replace(/[,;]/g, ''))
+ if (words[i]) f(words[i].replace(/[`,;]/g, ''))
}
function findTableByAlias(alias, editor) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/xml-hint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/xml-hint.js
index 543d19b6..2b315312 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/hint/xml-hint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/hint/xml-hint.js
@@ -101,12 +101,12 @@
}
replaceToken = true;
}
- function returnHintsFromAtValues(atValues) {
+ var returnHintsFromAtValues = function(atValues) {
if (atValues)
for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))
result.push(quote + atValues[i] + quote);
return returnHints();
- }
+ };
if (atValues && atValues.then) return atValues.then(returnHintsFromAtValues);
return returnHintsFromAtValues(atValues);
} else { // An attribute name
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/javascript-lint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/javascript-lint.js
index cc132d7f..e5bc7523 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/javascript-lint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/javascript-lint.js
@@ -1,6 +1,8 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
+// Depends on jshint.js from https://github.com/jshint/jshint
+
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.css b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.css
index f097cfe3..e1560db9 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.css
@@ -25,22 +25,20 @@
-ms-transition: opacity .4s;
}
-.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
+.CodeMirror-lint-mark {
background-position: left bottom;
background-repeat: repeat-x;
}
-.CodeMirror-lint-mark-error {
- background-image:
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
- ;
-}
-
.CodeMirror-lint-mark-warning {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
}
-.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
+.CodeMirror-lint-mark-error {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
+}
+
+.CodeMirror-lint-marker {
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
@@ -51,23 +49,31 @@
position: relative;
}
-.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
+.CodeMirror-lint-message {
padding-left: 18px;
background-position: top left;
background-repeat: no-repeat;
}
-.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
-}
-
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
}
+.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
+}
+
.CodeMirror-lint-marker-multiple {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
background-repeat: no-repeat;
background-position: right bottom;
width: 100%; height: 100%;
}
+
+.CodeMirror-lint-line-error {
+ background-color: rgba(183, 76, 81, 0.08);
+}
+
+.CodeMirror-lint-line-warning {
+ background-color: rgba(255, 211, 0, 0.1);
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.js b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.js
index 5bc1af18..1613deb9 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/lint/lint.js
@@ -11,6 +11,7 @@
})(function(CodeMirror) {
"use strict";
var GUTTER_ID = "CodeMirror-lint-markers";
+ var LINT_LINE_ID = "CodeMirror-lint-line-";
function showTooltip(cm, e, content) {
var tt = document.createElement("div");
@@ -58,35 +59,60 @@
CodeMirror.on(node, "mouseout", hide);
}
- function LintState(cm, options, hasGutter) {
+ function LintState(cm, conf, hasGutter) {
this.marked = [];
- this.options = options;
+ if (conf instanceof Function) conf = {getAnnotations: conf};
+ if (!conf || conf === true) conf = {};
+ this.options = {};
+ this.linterOptions = conf.options || {};
+ for (var prop in defaults) this.options[prop] = defaults[prop];
+ for (var prop in conf) {
+ if (defaults.hasOwnProperty(prop)) {
+ if (conf[prop] != null) this.options[prop] = conf[prop];
+ } else if (!conf.options) {
+ this.linterOptions[prop] = conf[prop];
+ }
+ }
this.timeout = null;
this.hasGutter = hasGutter;
this.onMouseOver = function(e) { onMouseOver(cm, e); };
this.waitingFor = 0
}
- function parseOptions(_cm, options) {
- if (options instanceof Function) return {getAnnotations: options};
- if (!options || options === true) options = {};
- return options;
+ var defaults = {
+ highlightLines: false,
+ tooltips: true,
+ delay: 500,
+ lintOnChange: true,
+ getAnnotations: null,
+ async: false,
+ selfContain: null,
+ formatAnnotation: null,
+ onUpdateLinting: null
}
function clearMarks(cm) {
var state = cm.state.lint;
if (state.hasGutter) cm.clearGutter(GUTTER_ID);
+ if (state.options.highlightLines) clearErrorLines(cm);
for (var i = 0; i < state.marked.length; ++i)
state.marked[i].clear();
state.marked.length = 0;
}
+ function clearErrorLines(cm) {
+ cm.eachLine(function(line) {
+ var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass);
+ if (has) cm.removeLineClass(line, "wrap", has[0]);
+ })
+ }
+
function makeMarker(cm, labels, severity, multiple, tooltips) {
var marker = document.createElement("div"), inner = marker;
- marker.className = "CodeMirror-lint-marker-" + severity;
+ marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity;
if (multiple) {
inner = marker.appendChild(document.createElement("div"));
- inner.className = "CodeMirror-lint-marker-multiple";
+ inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple";
}
if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
@@ -114,7 +140,7 @@
var severity = ann.severity;
if (!severity) severity = "error";
var tip = document.createElement("div");
- tip.className = "CodeMirror-lint-message-" + severity;
+ tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity;
if (typeof ann.messageHTML != 'undefined') {
tip.innerHTML = ann.messageHTML;
} else {
@@ -123,7 +149,7 @@
return tip;
}
- function lintAsync(cm, getAnnotations, passOptions) {
+ function lintAsync(cm, getAnnotations) {
var state = cm.state.lint
var id = ++state.waitingFor
function abort() {
@@ -136,22 +162,23 @@
if (state.waitingFor != id) return
if (arg2 && annotations instanceof CodeMirror) annotations = arg2
cm.operation(function() {updateLinting(cm, annotations)})
- }, passOptions, cm);
+ }, state.linterOptions, cm);
}
function startLinting(cm) {
- var state = cm.state.lint, options = state.options;
+ var state = cm.state.lint;
+ if (!state) return;
+ var options = state.options;
/*
* Passing rules in `options` property prevents JSHint (and other linters) from complaining
* about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.
*/
- var passOptions = options.options || options;
var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
if (!getAnnotations) return;
if (options.async || getAnnotations.async) {
- lintAsync(cm, getAnnotations, passOptions)
+ lintAsync(cm, getAnnotations)
} else {
- var annotations = getAnnotations(cm.getValue(), passOptions, cm);
+ var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm);
if (!annotations) return;
if (annotations.then) annotations.then(function(issues) {
cm.operation(function() {updateLinting(cm, issues)})
@@ -161,8 +188,10 @@
}
function updateLinting(cm, annotationsNotSorted) {
+ var state = cm.state.lint;
+ if (!state) return;
+ var options = state.options;
clearMarks(cm);
- var state = cm.state.lint, options = state.options;
var annotations = groupByLine(annotationsNotSorted);
@@ -170,6 +199,10 @@
var anns = annotations[line];
if (!anns) continue;
+ // filter out duplicate messages
+ var message = [];
+ anns = anns.filter(function(item) { return message.indexOf(item.message) > -1 ? false : message.push(item.message) });
+
var maxSeverity = null;
var tipLabel = state.hasGutter && document.createDocumentFragment();
@@ -183,14 +216,17 @@
if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
- className: "CodeMirror-lint-mark-" + severity,
+ className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity,
__annotation: ann
}));
}
-
+ // use original annotations[line] to show multiple messages
if (state.hasGutter)
- cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, anns.length > 1,
- state.options.tooltips));
+ cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1,
+ options.tooltips));
+
+ if (options.highlightLines)
+ cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity);
}
if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
}
@@ -199,7 +235,7 @@
var state = cm.state.lint;
if (!state) return;
clearTimeout(state.timeout);
- state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
+ state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay);
}
function popupTooltips(cm, annotations, e) {
@@ -239,8 +275,8 @@
if (val) {
var gutters = cm.getOption("gutters"), hasLintGutter = false;
for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
- var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
- if (state.options.lintOnChange !== false)
+ var state = cm.state.lint = new LintState(cm, val, hasLintGutter);
+ if (state.options.lintOnChange)
cm.on("change", onChange);
if (state.options.tooltips != false && state.options.tooltips != "gutter")
CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
@@ -250,6 +286,6 @@
});
CodeMirror.defineExtension("performLint", function() {
- if (this.state.lint) startLinting(this);
+ startLinting(this);
});
});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/merge/merge.js b/Mod manager/utils/QNModManager/CodeMirror/addon/merge/merge.js
index 827edb71..7fd963f7 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/merge/merge.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/merge/merge.js
@@ -508,6 +508,7 @@
copy.title = dv.edit.phrase(editOriginals ? "Push to left" : "Revert chunk");
copy.chunk = chunk;
copy.style.top = (chunk.origTo > chunk.origFrom ? top : dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit) + "px";
+ copy.setAttribute("role", "button");
if (editOriginals) {
var topReverse = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit;
@@ -518,6 +519,7 @@
origFrom: chunk.editFrom, origTo: chunk.editTo};
copyReverse.style.top = topReverse + "px";
dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px";
+ copyReverse.setAttribute("role", "button");
}
}
}
@@ -599,6 +601,7 @@
function buildGap(dv) {
var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock");
+ lock.setAttribute("role", "button");
var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
var gapElts = [lockWrap];
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex.js b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex.js
index 93fd9a5a..6140bc4f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex.js
@@ -12,7 +12,7 @@
"use strict";
CodeMirror.multiplexingMode = function(outer /*, others */) {
- // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects
+ // Others should be {open, close, mode [, delimStyle] [, innerStyle] [, parseDelimiters]} objects
var others = Array.prototype.slice.call(arguments, 1);
function indexOf(string, pattern, from, returnEnd) {
@@ -29,7 +29,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
return {
outer: CodeMirror.startState(outer),
innerActive: null,
- inner: null
+ inner: null,
+ startingInner: false
};
},
@@ -37,7 +38,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
return {
outer: CodeMirror.copyState(outer, state.outer),
innerActive: state.innerActive,
- inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)
+ inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner),
+ startingInner: state.startingInner
};
},
@@ -49,6 +51,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
var found = indexOf(oldContent, other.open, stream.pos);
if (found == stream.pos) {
if (!other.parseDelimiters) stream.match(other.open);
+ state.startingInner = !!other.parseDelimiters
state.innerActive = other;
// Get the outer indent, making sure to handle CodeMirror.Pass
@@ -74,7 +77,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
state.innerActive = state.inner = null;
return this.token(stream, state);
}
- var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1;
+ var found = curInner.close && !state.startingInner ?
+ indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1;
if (found == stream.pos && !curInner.parseDelimiters) {
stream.match(curInner.close);
state.innerActive = state.inner = null;
@@ -83,6 +87,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
if (found > -1) stream.string = oldContent.slice(0, found);
var innerToken = curInner.mode.token(stream, state.inner);
if (found > -1) stream.string = oldContent;
+ else if (stream.pos > stream.start) state.startingInner = false
if (found == stream.pos && curInner.parseDelimiters)
state.innerActive = state.inner = null;
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex_test.js b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex_test.js
index c51cad45..85039886 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex_test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/multiplex_test.js
@@ -30,4 +30,20 @@
MT(
"stexInsideMarkdown",
"[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");
+
+ CodeMirror.defineMode("identical_delim_multiplex", function() {
+ return CodeMirror.multiplexingMode(CodeMirror.getMode({indentUnit: 2}, "javascript"), {
+ open: "#",
+ close: "#",
+ mode: CodeMirror.getMode({}, "markdown"),
+ parseDelimiters: true,
+ innerStyle: "q"
+ });
+ });
+
+ var mode2 = CodeMirror.getMode({}, "identical_delim_multiplex");
+
+ test.mode("identical_delimiters_with_parseDelimiters", mode2, [
+ "[keyword let] [def x] [operator =] [q #foo][q&em *bar*][q #];"
+ ], "multiplexing")
})();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/simple.js b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/simple.js
index 655f9914..0d8cbdeb 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/mode/simple.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/mode/simple.js
@@ -68,6 +68,7 @@
var flags = "";
if (val instanceof RegExp) {
if (val.ignoreCase) flags = "i";
+ if (val.unicode) flags += "u"
val = val.source;
} else {
val = String(val);
@@ -137,10 +138,9 @@
var token = rule.token
if (token && token.apply) token = token(matches)
if (matches.length > 2 && rule.token && typeof rule.token != "string") {
- state.pending = [];
for (var j = 2; j < matches.length; j++)
if (matches[j])
- state.pending.push({text: matches[j], token: rule.token[j - 1]});
+ (state.pending || (state.pending = [])).push({text: matches[j], token: rule.token[j - 1]});
stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));
return token[0];
} else if (token && token.join) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode-standalone.js b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode-standalone.js
index e71041c3..76cf3d75 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode-standalone.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode-standalone.js
@@ -251,6 +251,7 @@
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min;
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) };
+ CodeMirror.countColumn = countColumn;
CodeMirror.defaults = { indentUnit: 2 };
@@ -322,7 +323,7 @@
if (!stream.string && mode.blankLine) { mode.blankLine(state); }
while (!stream.eol()) {
var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
+ callback(stream.current(), style, i, stream.start, state, mode);
stream.start = stream.pos;
}
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.js b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.js
index 2cae6863..f5d58e24 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.js
@@ -67,7 +67,7 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
if (!stream.string && mode.blankLine) mode.blankLine(state);
while (!stream.eol()) {
var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
+ callback(stream.current(), style, i, stream.start, state, mode);
stream.start = stream.pos;
}
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.node.js b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.node.js
index 92cda61b..ddd255ab 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.node.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/runmode/runmode.node.js
@@ -320,7 +320,7 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
if (!stream.string && mode.blankLine) { mode.blankLine(state); }
while (!stream.eol()) {
var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
+ callback(stream.current(), style, i, stream.start, state, mode);
stream.start = stream.pos;
}
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/search/jump-to-line.js b/Mod manager/utils/QNModManager/CodeMirror/addon/search/jump-to-line.js
index 1f3526d2..990c235e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/search/jump-to-line.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/search/jump-to-line.js
@@ -13,8 +13,11 @@
})(function(CodeMirror) {
"use strict";
+ // default search panel location
+ CodeMirror.defineOption("search", {bottom: false});
+
function dialog(cm, text, shortText, deflt, f) {
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
+ if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});
else f(prompt(shortText, deflt));
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/search/match-highlighter.js b/Mod manager/utils/QNModManager/CodeMirror/addon/search/match-highlighter.js
index 3a4a7ded..9b181ebc 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/search/match-highlighter.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/addon/search/search.js b/Mod manager/utils/QNModManager/CodeMirror/addon/search/search.js
index cecdd52e..24a0855e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/search/search.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/search/search.js
@@ -19,6 +19,9 @@
})(function(CodeMirror) {
"use strict";
+ // default search panel location
+ CodeMirror.defineOption("search", {bottom: false});
+
function searchOverlay(query, caseInsensitive) {
if (typeof query == "string")
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
@@ -63,12 +66,13 @@
selectValueOnOpen: true,
closeOnEnter: false,
onClose: function() { clearSearch(cm); },
- onKeyDown: onKeyDown
+ onKeyDown: onKeyDown,
+ bottom: cm.options.search.bottom
});
}
function dialog(cm, text, shortText, deflt, f) {
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
+ if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});
else f(prompt(shortText, deflt));
}
@@ -185,18 +189,43 @@
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
});}
+ function el(tag, attrs) {
+ var element = tag ? document.createElement(tag) : document.createDocumentFragment();
+ for (var key in attrs) {
+ element[key] = attrs[key];
+ }
+ for (var i = 2; i < arguments.length; i++) {
+ var child = arguments[i]
+ element.appendChild(typeof child == "string" ? document.createTextNode(child) : child);
+ }
+ return element;
+ }
function getQueryDialog(cm) {
- return '' + cm.phrase("Search:") + ' ' + cm.phrase("(Use /re/ syntax for regexp search)") + ' ';
+ return el("", null,
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("Search:")), " ",
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}), " ",
+ el("span", {style: "color: #888", className: "CodeMirror-search-hint"},
+ cm.phrase("(Use /re/ syntax for regexp search)")));
}
function getReplaceQueryDialog(cm) {
- return ' ' + cm.phrase("(Use /re/ syntax for regexp search)") + ' ';
+ return el("", null, " ",
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}), " ",
+ el("span", {style: "color: #888", className: "CodeMirror-search-hint"},
+ cm.phrase("(Use /re/ syntax for regexp search)")));
}
function getReplacementQueryDialog(cm) {
- return '' + cm.phrase("With:") + ' ';
+ return el("", null,
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("With:")), " ",
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}));
}
function getDoReplaceConfirm(cm) {
- return '' + cm.phrase("Replace?") + ' ' + cm.phrase("Yes") + ' ' + cm.phrase("No") + ' ' + cm.phrase("All") + ' ' + cm.phrase("Stop") + ' ';
+ return el("", null,
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("Replace?")), " ",
+ el("button", {}, cm.phrase("Yes")), " ",
+ el("button", {}, cm.phrase("No")), " ",
+ el("button", {}, cm.phrase("All")), " ",
+ el("button", {}, cm.phrase("Stop")));
}
function replaceAll(cm, query, text) {
@@ -213,8 +242,11 @@
function replace(cm, all) {
if (cm.getOption("readOnly")) return;
var query = cm.getSelection() || getSearchState(cm).lastQuery;
- var dialogText = '' + (all ? cm.phrase("Replace all:") : cm.phrase("Replace:")) + ' ';
- dialog(cm, dialogText + getReplaceQueryDialog(cm), dialogText, query, function(query) {
+ var dialogText = all ? cm.phrase("Replace all:") : cm.phrase("Replace:")
+ var fragment = el("", null,
+ el("span", {className: "CodeMirror-search-label"}, dialogText),
+ getReplaceQueryDialog(cm))
+ dialog(cm, fragment, dialogText, query, function(query) {
if (!query) return;
query = parseQuery(query);
dialog(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function(text) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/search/searchcursor.js b/Mod manager/utils/QNModManager/CodeMirror/addon/search/searchcursor.js
index d5869578..230017b7 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/search/searchcursor.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/search/searchcursor.js
@@ -202,6 +202,7 @@
function SearchCursor(doc, query, pos, options) {
this.atOccurrence = false
+ this.afterEmptyMatch = false
this.doc = doc
pos = pos ? doc.clipPos(pos) : Pos(0, 0)
this.pos = {from: pos, to: pos}
@@ -237,21 +238,29 @@
findPrevious: function() {return this.find(true)},
find: function(reverse) {
- var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to))
-
- // Implements weird auto-growing behavior on null-matches for
- // backwards-compatibility with the vim code (unfortunately)
- while (result && CodeMirror.cmpPos(result.from, result.to) == 0) {
+ var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
+ if (this.afterEmptyMatch && this.atOccurrence) {
+ // do not return the same 0 width match twice
+ head = Pos(head.line, head.ch)
if (reverse) {
- if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1)
- else if (result.from.line == this.doc.firstLine()) result = null
- else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1)))
+ head.ch--;
+ if (head.ch < 0) {
+ head.line--;
+ head.ch = (this.doc.getLine(head.line) || "").length;
+ }
} else {
- if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1)
- else if (result.to.line == this.doc.lastLine()) result = null
- else result = this.matches(reverse, Pos(result.to.line + 1, 0))
+ head.ch++;
+ if (head.ch > (this.doc.getLine(head.line) || "").length) {
+ head.ch = 0;
+ head.line++;
+ }
+ }
+ if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {
+ return this.atOccurrence = false
}
}
+ var result = this.matches(reverse, head)
+ this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0
if (result) {
this.pos = result
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/tern/tern.js b/Mod manager/utils/QNModManager/CodeMirror/addon/tern/tern.js
index 7be36818..a8837174 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/tern/tern.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/tern/tern.js
@@ -231,8 +231,7 @@
var content = ts.options.completionTip ? ts.options.completionTip(cur.data) : cur.data.doc;
if (content) {
tooltip = makeTooltip(node.parentNode.getBoundingClientRect().right + window.pageXOffset,
- node.getBoundingClientRect().top + window.pageYOffset, content, cm);
- tooltip.className += " " + cls + "hint-doc";
+ node.getBoundingClientRect().top + window.pageYOffset, content, cm, cls + "hint-doc");
}
});
c(obj);
@@ -637,12 +636,44 @@
}
}
- function makeTooltip(x, y, content, cm) {
- var node = elt("div", cls + "tooltip", content);
+ function makeTooltip(x, y, content, cm, className) {
+ var node = elt("div", cls + "tooltip" + " " + (className || ""), content);
node.style.left = x + "px";
node.style.top = y + "px";
var container = ((cm.options || {}).hintOptions || {}).container || document.body;
container.appendChild(node);
+
+ var pos = cm.cursorCoords();
+ var winW = window.innerWidth;
+ var winH = window.innerHeight;
+ var box = node.getBoundingClientRect();
+ var hints = document.querySelector(".CodeMirror-hints");
+ var overlapY = box.bottom - winH;
+ var overlapX = box.right - winW;
+
+ if (hints && overlapX > 0) {
+ node.style.left = 0;
+ var box = node.getBoundingClientRect();
+ node.style.left = (x = x - hints.offsetWidth - box.width) + "px";
+ overlapX = box.right - winW;
+ }
+ if (overlapY > 0) {
+ var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
+ if (curTop - height > 0) { // Fits above cursor
+ node.style.top = (pos.top - height) + "px";
+ } else if (height > winH) {
+ node.style.height = (winH - 5) + "px";
+ node.style.top = (pos.bottom - box.top) + "px";
+ }
+ }
+ if (overlapX > 0) {
+ if (box.right - box.left > winW) {
+ node.style.width = (winW - 5) + "px";
+ overlapX -= (box.right - box.left) - winW;
+ }
+ node.style.left = (x - overlapX) + "px";
+ }
+
return node;
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/addon/wrap/hardwrap.js b/Mod manager/utils/QNModManager/CodeMirror/addon/wrap/hardwrap.js
index f194946c..516368c8 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/addon/wrap/hardwrap.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/addon/wrap/hardwrap.js
@@ -35,7 +35,7 @@
for (; at > 0; --at)
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
- if (at == 0 && !forceBreak) {
+ if (!forceBreak && at <= text.match(/^[ \t]*/)[0].length) {
// didn't find a break point before column, in non-forceBreak mode try to
// find one after 'column'.
for (at = column + 1; at < text.length - 1; ++at) {
@@ -91,7 +91,8 @@
}
while (curLine.length > column) {
var bp = findBreakPoint(curLine, column, wrapOn, killTrailing, forceBreak);
- if (bp.from != bp.to || forceBreak) {
+ if (bp.from != bp.to ||
+ forceBreak && leadingSpace !== curLine.slice(0, bp.to)) {
changes.push({text: ["", leadingSpace],
from: Pos(curNo, bp.from),
to: Pos(curNo, bp.to)});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/anywordhint.html b/Mod manager/utils/QNModManager/CodeMirror/demo/anywordhint.html
index 471b5bde..57df9a36 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/anywordhint.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/anywordhint.html
@@ -8,7 +8,7 @@
-
+
CodeMirror
@@ -29,33 +29,31 @@
Any Word Completion Demo
(function() {
"use strict";
- var WORD = /[\w$]+/g, RANGE = 500;
+ var WORD = /[\w$]+/, RANGE = 500;
CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
var word = options && options.word || WORD;
var range = options && options.range || RANGE;
var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
- var start = cur.ch, end = start;
- while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
+ var end = cur.ch, start = end;
while (start && word.test(curLine.charAt(start - 1))) --start;
var curWord = start != end && curLine.slice(start, end);
- var list = [], seen = {};
- function scan(dir) {
- var line = cur.line, end = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
- for (; line != end; line += dir) {
+ var list = options && options.list || [], seen = {};
+ var re = new RegExp(word.source, "g");
+ for (var dir = -1; dir <= 1; dir += 2) {
+ var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
+ for (; line != endLine; line += dir) {
var text = editor.getLine(line), m;
- word.lastIndex = 0;
- while (m = word.exec(text)) {
- if ((!curWord || m[0].indexOf(curWord) == 0) && !seen.hasOwnProperty(m[0])) {
+ while (m = re.exec(text)) {
+ if (line == cur.line && m[0] === curWord) continue;
+ if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
seen[m[0]] = true;
list.push(m[0]);
}
}
}
}
- scan(-1);
- scan(1);
return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
});
})();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/closetag.html b/Mod manager/utils/QNModManager/CodeMirror/demo/closetag.html
index 4f857fa4..1f86114a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/closetag.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/closetag.html
@@ -38,4 +38,5 @@
Close-Tag Demo
autoCloseTags: true
});
+
Uses the closetag addon to auto-close tags.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/complete.html b/Mod manager/utils/QNModManager/CodeMirror/demo/complete.html
index 2fef7964..3e7bd5ff 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/complete.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/complete.html
@@ -71,7 +71,7 @@
Autocomplete Demo
addons.
@@ -88,7 +88,7 @@
Autocomplete Demo
["here", "hither"],
["asynchronous", "nonsynchronous"],
["completion", "achievement", "conclusion", "culmination", "expirations"],
- ["hinting", "advive", "broach", "imply"],
+ ["hinting", "advise", "broach", "imply"],
["function","action"],
["provide", "add", "bring", "give"],
["synonyms", "equivalents"],
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/lint.html b/Mod manager/utils/QNModManager/CodeMirror/demo/lint.html
index 1184232d..a479cdd3 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/lint.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/lint.html
@@ -9,7 +9,7 @@
-
+
@@ -150,7 +150,7 @@
Linter Demo
lineNumbers: true,
mode: "javascript",
gutters: ["CodeMirror-lint-markers"],
- lint: true
+ lint: {options: {esversion: 2021}},
});
var editor_json = CodeMirror.fromTextArea(document.getElementById("code-json"), {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/matchhighlighter.html b/Mod manager/utils/QNModManager/CodeMirror/demo/matchhighlighter.html
index 6aa93778..8e0ff25b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/matchhighlighter.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/matchhighlighter.html
@@ -98,6 +98,6 @@
Match Highlighter Demo
});
-
Search and highlight occurences of the selected text.
+
Search and highlight occurrences of the selected text.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/mustache.html b/Mod manager/utils/QNModManager/CodeMirror/demo/mustache.html
index 2d193f09..f37f01b5 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/mustache.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/mustache.html
@@ -61,7 +61,7 @@
{{title}}
Demonstration of a mode that parses HTML, highlighting
- the Mustache templating
+ the Mustache templating
directives inside of it by using the code
in overlay.js
. View
source to see the 15 lines of code needed to accomplish this.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/simplemode.html b/Mod manager/utils/QNModManager/CodeMirror/demo/simplemode.html
index d7b0cfac..b03335fb 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/simplemode.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/simplemode.html
@@ -129,7 +129,7 @@
Simple Mode Demo
*/
CodeMirror.defineSimpleMode("simplemode", {
- // The start state contains the rules that are intially used
+ // The start state contains the rules that are initially used
start: [
// The regex matches the token, the token property contains the type
{regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: "string"},
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/tern.html b/Mod manager/utils/QNModManager/CodeMirror/demo/tern.html
index c6834e88..e331fd5c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/tern.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/tern.html
@@ -13,16 +13,16 @@
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -109,7 +109,7 @@
Tern Demo
}
var server;
- getURL("//ternjs.net/defs/ecmascript.json", function(err, code) {
+ getURL("https://unpkg.com/tern/defs/ecmascript.json", function(err, code) {
if (err) throw new Error("Request for ecmascript.json: " + err);
server = new CodeMirror.TernServer({defs: [JSON.parse(code)]});
editor.setOption("extraKeys", {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/theme.html b/Mod manager/utils/QNModManager/CodeMirror/demo/theme.html
index 95d0f391..1ccac88c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/theme.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/theme.html
@@ -7,6 +7,7 @@
+
@@ -27,6 +28,7 @@
+
@@ -106,6 +108,7 @@
Theme Demo
default
3024-day
3024-night
+
abbott
abcdef
ambiance
ayu-dark
@@ -128,6 +131,7 @@
Theme Demo
icecoder
idea
isotope
+
juejin
lesser-dark
liquibyte
lucario
diff --git a/Mod manager/utils/QNModManager/CodeMirror/demo/vim.html b/Mod manager/utils/QNModManager/CodeMirror/demo/vim.html
index c939505d..41406b4a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/demo/vim.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/demo/vim.html
@@ -6,8 +6,6 @@
-
-
@@ -56,6 +54,7 @@
Vim bindings demo
}
Key buffer:
+
Vim mode:
The vim keybindings are enabled by including keymap/vim.js
and setting the
@@ -95,19 +94,22 @@
Vim bindings demo
mode: "text/x-csrc",
keyMap: "vim",
matchBrackets: true,
- showCursorWhenSelecting: true,
- inputStyle: "contenteditable"
+ showCursorWhenSelecting: true
});
var commandDisplay = document.getElementById('command-display');
var keys = '';
CodeMirror.on(editor, 'vim-keypress', function(key) {
keys = keys + key;
- commandDisplay.innerHTML = keys;
+ commandDisplay.innerText = keys;
});
CodeMirror.on(editor, 'vim-command-done', function(e) {
keys = '';
commandDisplay.innerHTML = keys;
});
+ var vimMode = document.getElementById('vim-mode');
+ CodeMirror.on(editor, 'vim-mode-change', function(e) {
+ vimMode.innerText = JSON.stringify(e);
+ });
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/docs.css b/Mod manager/utils/QNModManager/CodeMirror/doc/docs.css
index 17b92124..4a199879 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/doc/docs.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/docs.css
@@ -2,7 +2,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
- src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff');
+ src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(source_sans.woff) format('woff');
}
body, html { margin: 0; padding: 0; height: 100%; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/internals.html b/Mod manager/utils/QNModManager/CodeMirror/doc/internals.html
index 2137c937..893604e9 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/doc/internals.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/internals.html
@@ -293,7 +293,7 @@
Intelligent Updating
Parsers can be Simple
When I wrote CodeMirror 1, I
-thought interruptable
+thought interruptible
parsers were a hugely scary and complicated thing, and I used a
bunch of heavyweight abstractions to keep this supposed complexity
under control: parsers
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/4me.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/4me.svg
new file mode 100644
index 00000000..8e894ee1
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/4me.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/anvil.png b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/anvil.png
new file mode 100644
index 0000000000000000000000000000000000000000..7cb2ab1d3423b40a2b50ffd74c75f02d03dff95f
GIT binary patch
literal 9512
zcmV+@CD+=CP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006
zVoOIv0RI600RN!9r;`8x010qNS#tmY4c7nw4c7reD4Tcy000McNliru
zh8q9?Bo|3UK~#9!?VWj?9Cexh-%nL{PtTEL!sNaQBqWmr5l}$zK=48!q6jFi=z=b*
zxU$RYPhDAmyPm5k-p7i%`a={HAt2s>;EKp45E61g5^_zFnM@|hTzynMzdxStoLxOv
zUz2>_uUBP~bWioSs;fTre4pzp)Hn-%-i{ZuzpH=X$5s1~91e#AsrCR4<-~j1$Yy<11rbH+1p290WsG_>iO__SM2R89
zK$9r-iiC*v38WRt3X)O6KG1HI?!ZfQdx@TY>90csLrKWlrR*0KWqv^nI@vMRb`IAOkgI$3}6P(f>MvrsJUa1yeW)^iu4HdD%uWgM%jYM
zMp3pXw281$JlPNiK{w*8Fxm
zB7>)_xL|TMPLIRkI0~qk_%67!gZU?Q@Z8^8yo`EHF+X^nz{MboL1(MdC{ocO8T&Q9
zN6{Aq9vAqj3J(xU-_*x;hg(k>$FmnXmxRONC>>>2x_Qgmi2`?y@sQ+2AMs+mtf_aCRBTv4u@luQx^GKw5%Nk
ze8NOly~PMuigKC4c#&F^+#)Ed=q^NV5%@l#zXF1EEaUO?B`wt+ox|Z6rIc0(Rhf71
zF5=8(BAi(511-@3K7-1)QGTW|-Qk78ilxpM>~J`SPD#c0_i>bFKB&MsDIzO<(;TV_^>EnWB+wq8t5X@5a<0zLS)E~LB
zdoY%vrh9>#fd9%;zavhsu3YMhGaL>_afYpu3zl^d(l0)B^98O4y+o1t(ILBsqA5jg
z2KiKmz88|z>oZGTI-0}bh{hYvFSRb~AdN3Rb&Eki2fU4=R(JuV4tSRke!7mj<0mIt
zWZ@m#t34=(!%@QwSuYpg)s8O#>A*h$;Rb>8t9=l)fK@3gqVoR~{kV^848xEWZ+0#S
zhr@9=L$-XwFd!THvqkuKfj3tB0BQxROcoSWKvTcYk
zMbYa)FXd>7tPK(YRKy4V9^u1YIx}{{kJnXuSPqAy1{t*Ywk~T2C8>DVqFkT+8G7>=PRK*Wj!ROybR?UMJ7Ap9hlrX
znuEx{sOtI^Yo|U{?J+qVM>ykw6M-{;X_ydq0#5^f1-1ggAoddjjsso=%){d8&ja`8
zer8KC*a3C4by+(h%<$lgC~sAv>g{(&6RLzFdXsp36xGfZ7rN{RhocNk1^yGb6iBjv
zR?t^hs`{0;~Q*w^X6jljtV>?Z`C1g-`CQi=f=bvv})-36*iflGil;e>a{h~S}e
ziH0ma(wYo895uvyfwuu;u=~u^&T*8fcNBsY{m9b
zl1#5+mT%0<@LJ%lE}M7ch=_>Fy9G|AMAH_B!vR1FXk-6sj8UY44b>iOo`NE<==L2F
zh>QXLQ53ggWQkB=sw!7yRGa4CzQaAz9FEcu0Jj3$io7QU+y^{f?ZM_Lm}-`76k`3s
z>wr^Th^^$D2XeBAK2Ys}I2=b1cVq5{Yp^u2d|qw<>;jenUj_D5d!Ts==lN!24CuSW
zB8QF=VbyPpMY&RZ?-8K4+GBEzY8tWNPcP6{?ZK3oe1<`q!R6KVVb2fn%}2mGlU#TvnC5-zK01ySU5w9V?K*
zZk|kT>jnC&anMDmXMb9f&&Yl9VeXiN+|N=UZxTy|IvXn{SP%Rfc#45@SVsdV0I$RZ
zv>jN5xeIm=@OxRzvVAJI9mqib;EHpY_==JgxL8G7T;H5BV7(_NfWF=9%Kk5vy;&N8
zSLe3lun2KEzvK`To)l)8^kEf8TQL9JHeg-u-<2TAeyeDFZkvFm0>*Q%=W{zpaS=20W^-vX~C4l987#FK^?FZ_$)B1+NS{%q^-bnm|*-7
zcnA}#QZgRP?R*htQ5^@&0FKFRl|nJ$?F2SsWvZ(&3+>U|`4|WRW^=gk0-On454;}}
z_t8i*@L}L}hy4F!;5y6-{yw!ga~c*0iEr!O9cUPyD=@p3bXRrMJj@P53I;3%MP~x%
zoOD~~x+gEGhz5)Y-cD@@FW8ON476fa&ZWSEz;}SZG4dI~1mI1;1-Z|dN%8#6awC|l
zrv>X5a5na!*$Aw}e3f@l+_DqQ%`h|K^*3S<~omyW+oXkiWVx`ol$2Ya|2N&>h7SPOiQ(c}O1uoZFs5f~fs9>rz~#e}yGxDvDeTd?aY
zh2{2Mk3HN6(^#h>>=WM;?%4)eeX+ozs5e)_0u6!bNsseq)KMQ3RAFpFc>T0Gnqs3z
zd^h(7{Bm=OJ(-9%hzLq+HXbek9;v{Pb_0LH#BEUB?5cndECD`+SvucgXc6i<%-a1F
zFqhF)%+i7hP%GwExP!wVJ_>9CZpKoo3Vn~0FyHTUm@B8Iti1vV_MLwa^T$W=B=B>h
zGlcRpi|erO{y?S!{|Y?8z(Ko;vG2rjU74Hy>v>ap=rZsrHV{Sdo
ziTxiIlc*_t?b4lzzV0pUOlPUel0|oKe`Li4WzTxpi&;ZcfOD{n2cPmsRW
zrn%5`tb5cZEI)HF0^(r}QEtF|x`QRetW2f!R*{$6;tcLVAeb-r^O%KK=-BsSfu{w)
z>m&BF7!#XKmAn;+yX*H3@5OG84N|iaERIVhx=h$3&zUlH2F?4BWLUmD}GA%pbS|3xZ`R
zz56GhJuw~&8coQZgIN@R2+aik5AY0!i)a3O%m+?eBhJU`fPcdLzg;Chu2NA4yd$?o
zJ)HIeUjgo+xEn<l7Z?8i_u_Uxl^jdj-)J$;*J(VitQb
zJm6xik#^M0m&JUkzX$$|^>^J~;bWhQJ@j6lJFb@yEeK1nl(J71culd)kk4UO@{|Ja
z@i9?*7We_R7l89~=ir}-?naiv0&M@o5m=Cv6W?~Qr|3c=)Ym$53BTQ%ramToU_m33
zk~Q@psTiut_WqDfJt3QV1KRomI#VXRohfBqcb4}4Fn8Xf4a?k$$Me;EU6l~uT0pU+
z`BhkB>+67bVs4N_X$DTie0{}yb@?>9C=t(K0{(SObgM;MZu>oOCl(ZZ8-)e95eve#
zP&fl3i@7D{WB$@Y)u`h!aa)7=e`_V!B$(Ue--yoKQ0yW3MT+-q7`4Q}rpc|#m5xnap4e5D|2aq>
z^=t;7Dj%t=!z{ZASi}B85?0_~3ZV@-GyCn}@j`Hep#1)egW3_E7k@BF9Z`te?al(nlmQfF-}6UVLT@u9#Rz
zhsr%$QuJh%_npwdysvHK_kr|NytF!j^_>`ql~}OxdlW9B@qmkR@4J!eHJI^%w_?Q<
zQO(c$fv*9#Q=8ve$*^gP(8M6c7jhM{2%##=yE1&@sep@TCwbG%B-0wa(g{-q>B}n5
z?9TG@4gEaSo@RGO$%gxlG_Sl1*i8o+OKHV7feG#LSb*m=EZB1l`%|C}wSvn<-s*h;
zn@Zl!!2-}mv_)3Ozz>Ik#$T&9@j&Tq!r&tGin&(4fLXzXifP7Rxxs5Oe{(eoFiysN
z&{3&?A=Vo5TR?Xe##d4DKB6XI`cUsc5!vSt{qMDXJlc`r;@L?~X^Atv-ea`%0^Z&i
zaL1+;w{7TWdoECB1tpbOF;oGWjxd(eOpQG(SM(grk9rzr@m4})2Vx;64v%xN|FMtg
zXm-SgP6c?6>;zDR7SAqgVj$2F(9^LB#t`#&U?S!~DgSU@Ue`
zUQpyc>oDP6LG^=z6(I&7_Ol^6$9G^vKoL@ba&KFjKkvxU+8krixEPC?ZJX2Nlc4)NDWz4Iv9vXYgJf1k#?(#iE`+0X@DP{LFdiqg}nAib7M{IeSD_DpLWJ2YMof)3k
znPGgL$DBr=X$>AT8+_(8`OIkam{{l2QYVawSN?ue;Pw~#`R&$JRfQJ>RO>;98}t%v
z=JFw|qG_PuR5j@XZo;gaLvOM)PJBy&Vgbw>fd8U!0ImtML|0+{_ra_bF&qRq33GKs
zEyvym+=4YyI?`6-C`vBRSL+ZdsZA<55mr@pr$hdh3VEUvlD;rDE{ur_Nnfbct7?%*H)O#G)UrMoZGmrF4~69M|j#xNB32zCf$)P!woDN0f2!HsHMsEW82x
zBkXOM)e}(OX`W#I$gNmV=m82_Tjd_d(L@FdTpfo!lnVvmrUD4-wEJh60JdW{Xr%;C
zG0QgZS}24Q-_p{9Wev;&E~l_t>qM*o<9*lzxs>O>0juD9ZISmZ2mXWFDt@ULxqzD&
z3L)hVD(6$w_I*n3FV?A2QB^VunGkxiN@pr$LwCUPt}Gv0+{En0(g<)WRG!?Gr8}c#
z@6t9%l;L0a7h|QGQEbCjZT$h(K&GY^5iHR;a1^E!tL&SL6SKeWzB1*HJ#!U|9suN4%cE{J(FZbbX#r$6Ojw
zUF-G&U&cC>)oKoQ*|Fe;Xd01ht=S!UQ4SOy+@4`?MoZGreQ!qTuK{20K9pW`SS=+N
zP`o(iC%`YT9NHTDb{!Q$f%~umjLwMnG-Kt*XO-adj>R7MCq%p+V%OzOlzzRwQAIAY
zELothcGT!#RF$5r(w!}h>6`F{m{%ieWchu4$gsqB7SYzlF5p*0-*AqjhX7ms;=4rm
zjh+j946BG7E-hFS{8td|!~89lh0#^*lTvL=d{wik)@+iy2-L@*F;7Ns=Wh
zmi0wAcS?du^`3>;tEj(fUCp)-vS%2-UaVh3h`Y!g2cuX|hc93=qe6_sDkaZh@axXa
z!(0|oe%>D7`&j(J1$}dv_?neeb1Nx?s?^7XD~_w@r19~R_6&aM#5m_nN#y!YXw__f
z`*gMhLD|bZ9S*RpnqOi$z){!STxl}eg0gZ%Qsu|q^
zn`>eMj#;}wsEmyZSIn*F;#o;byZS7Q0RQ43%`hvgWrq*en;Rm1~WdC>$^*d!ubt96Q0l~5H=
zgwrP^_{ic$-f?U_;}YdFhD3zv4L;YkHuC-x8fYCC%lUvSc@lITs^xO|)M)bHVKib(
zsu!Zr(nF5YuolZcSRL_t5-SmYV}aLNvC`zIJo8C8G_H?59&V@p+RGce5wkGCJ2WN~whTQ~Ichqe^mSuIOLpF<8D6z
z#J6MIxc-)&-qk3*D%v0wn6U;5XH1B5_56Akj*AW2#Sp5J4xytzWJOn&mAkXF_lI<4
zYzg;&`ZUIb*dUr_PE2~7KfR7qTjD&lBg2o@^|7wI^saCPL}Z7+
zvl0Zu{eUf)I883_+A-K-g-=p^k;ZD`V_mQQj_AbvO}Jo9x#`0iFD<}|Bo4h1^9|Tn
z15abUAfnorK8X2}E44~SsYz2jKR%h;Mr;u56W?>6e3B>T&07wv7i3W-jxq%1j`2Bh
ze4K_sTD!ejWyS6+cW&(G;STHfkO`GQA=G@euC=I)ih9*bsV;$DS{b_1@wpEONY(^QyoZLBTAL$3}6Wt~5$viRvoy}6u;o~XHCaCsYi9Dlx!>u*e5qL~
zca!+o4LlZ@4ZInfx*kJxV6ZbcX6JS&KZ^C&{S3Br``iNWX)f~nyD`7
zo~ARUd}vW4r?kWdRkTqaWm2r1n|sIJyn7@83B~+t=V8H*Ld39@1YU#{)2zmtSMS6`
zxDo-8{8C2~F)Md|?%&18uX1odqt}WWZG^xdurlCJVg(d~A%(4+{6j{6a8$9>xb+l{
zL-@c|x%b_S%|3_Ko$Vm;U2#zh3zzM<7q|+M7Y%2JLnW)wA1Yo@_zn}Gy+7out9rSA
zTY6uRZm3AElUDXl=&;_#Ji)c2#@uCE{tU|HbhX
zo}7=xQt)05{1JEzyAL-pgf4=I<#RRmr`Gh=B_CC2714M(Q$=F}k91`C^wZtMyyz}t
zyHX*KbYzAtym>?fALZeW44+xv!=$8F)a=WK%JN;MUt3U-e&CM{iOlvA?eY#xSg$8K
zWotCC3iAa&Fv$0hmVD;X!Y(XMFc)|Og{#-{tiV#$hMO)~i|oX#+B1o6u_?eyb6Y#s
ztbR*wTaStHUvv8^$YJ7}iNykiAB&yz>E%2^PlR>dS=R2&7M)m%m{6A@=T=0>gvy_G
zqz7)OlmA>wnD48A=+@BVCr@mgJmTHu$Y2-CR;(oSTuQepK_$sz{a$YX{>0#2A_J}e
zR!QIXPzeWkty+1q>#=2iW?_ELLTm^AFYsuU#&{@cqQB>2uNC4?Sdqvli7o)jGm(SK
zu)8rqeirke|BeFR<6$@GQ*W8d!eu-Ds>p*Nmq_ua-iYx8syrrdTc7EoSE
zfor;;u(n+Ou>f?Zz=aastlKdR6y2`yAqo7pj$1!pj*r-lMXm3|gzSaf|Hm?S>y
zgN>nHY$cNap?b^hC|22)242Gc2gF{?qWd?WUur41#qGUR&7)6_pdy9ag@(5;zqL=Iq3}f!$2?#jPI`t}ZNZT!5bew^3UGHpQ;7k6}W0
zI(9DGv1$KL7~Vsy9}~|@v88V<+K0!-$9*P}bEli6?^Vp-tR|{hs>{v%S-u!+WFn8Xob3dnIE}3Jn
z!l6UG3BSRF`>@3liUnoDP`t-by$ST=BI0_jjs(>d$T#q0O{zM*+iUSgamP10#$M~=
ztHfCI`|ZJIC4a_*b{6LDnuQsulQE0C9-G1Zn26a+QERAmSqCU5AmR5=&a6<;+YyPX
z{*qAMuQ4{Rx^Uvicj$09YL&bzujo38MXlMDODEv@;W}0Mj*4`St_NUkkV|KKK}2p!
zCv}SxUWem|rw5C<6z!!lpesRDGOGSvqWU97cg=QH5Yc|nABpgLKP&G1IUEjP5aPSy
z!in_xeY-{YCh&W-imOeIGIH4s_aOQmpm&Y4dL0f&jzI;{#%IRji9CaHA*wO<^YEgxBG46lBPS6JyjP=EwGc-Y6p9#brPo
zNWUUqM!jzYlI?2_U16ZZ;V8_I#drDnQ|L{l=<43t4)R$=zXIAK|I?_%5P`^y;fBJ36ZfnlAVrLRCg+TDHQJ;
zi5R>4_A1X^=CT_c4o5U2(#ZvP?LzyuL85uAFa9+MA5>)$Qi+ARI``uxPH%3gIFVd7q-k0sbfp#|4V6Lisu(
zcPG+&w)DjsS#!~pYLCm|aExNgs)CE}YDdK*2!f<1EKplf_hLaNaqvQiHH3L~RW&8Z
z7DR6e(I1D(dSAShipQ!8TdF-shr=<-sfY=>@Xj41$Vf`!NfGaOQGF+>OBH5_NIkWX
z9GuG?Q=tdgi0U#z?+2cz8=F$&`*+uMvg%Efsys-C!*QfgG0AIPwgU}Ah$n<}5JU6?
zgiA#@6PSz2Oi-`VOBI>sYACQ7SgXi=3b(0->%B}olw?}78nWg>S1RmqI7&xV?9GL@
zcA)VP@c?1Gz!|FYT7;8nklc|R
z*f>`>ps~6AqfOy?glB=(g04noMVM?~@1-Vy4=c}it_6p~QGTi}zIjeq*1oUYE(WBL
zV?1=0pi@zqfG|~ICdzaXouEhqO1%gTK!YlZ&?{&UN*~axLVM1guvt~w1nE%N8u)BX
zWWzn72dE&~MhNR!aY@ab4u`{Wgj17hGk@6*Jj}WklrR=hPcqgQ24f`9MiH%7B!&_b
zAqK>A;+qvTBT7~wtD=1Z-Su^u?sPUD1X&*i)Pt05UK#F)cANEipAzF*Z6dFgi6bD=;uRFff9W86N-u03~!q
zSaf7zbY(hiZ)9m^c>ppnGB7PLGc7YQR53C-FgZFiG%GMLIxsL;
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/cargo.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/cargo.svg
new file mode 100644
index 00000000..06901833
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/cargo.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/codepen.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/codepen.svg
new file mode 100644
index 00000000..cc3d1273
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/codepen.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/desmos.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/desmos.svg
new file mode 100644
index 00000000..b47e4d90
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/desmos.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/executeprogram.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/executeprogram.svg
new file mode 100644
index 00000000..0f75b69e
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/executeprogram.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/holmusk.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/holmusk.svg
new file mode 100644
index 00000000..80d18829
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/holmusk.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/jetbrains.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/jetbrains.svg
new file mode 100644
index 00000000..b3795366
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/jetbrains.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/observable.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/observable.svg
new file mode 100644
index 00000000..49c3a82f
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/observable.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/primo.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/primo.svg
new file mode 100644
index 00000000..ec2f3de7
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/primo.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/logos/prisma.svg b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/prisma.svg
new file mode 100644
index 00000000..6249376f
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/logos/prisma.svg
@@ -0,0 +1 @@
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/doc/manual.html b/Mod manager/utils/QNModManager/CodeMirror/doc/manual.html
index 8635a1e0..a1ac2639 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/doc/manual.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/doc/manual.html
@@ -70,7 +70,7 @@
@@ -192,16 +195,28 @@ Browser support
diff --git a/Mod manager/utils/QNModManager/CodeMirror/keymap/emacs.js b/Mod manager/utils/QNModManager/CodeMirror/keymap/emacs.js
index fe4882eb..9e7ae60f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/keymap/emacs.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/keymap/emacs.js
@@ -11,6 +11,7 @@
})(function(CodeMirror) {
"use strict";
+ var cmds = CodeMirror.commands;
var Pos = CodeMirror.Pos;
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
@@ -30,7 +31,8 @@
var lastKill = null;
- function kill(cm, from, to, ring, text) {
+ // Internal generic kill function, used by several mapped kill "family" functions.
+ function _kill(cm, from, to, ring, text) {
if (text == null) text = cm.getRange(from, to);
if (ring == "grow" && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
@@ -156,17 +158,17 @@
var i = selections.length;
while (i--) {
cursor = selections[i].head;
- kill(cm, cursor, findEnd(cm, cursor, by, dir), ring);
+ _kill(cm, cursor, findEnd(cm, cursor, by, dir), ring);
}
}
- function killRegion(cm, ring) {
+ function _killRegion(cm, ring) {
if (cm.somethingSelected()) {
var selections = cm.listSelections(), selection;
var i = selections.length;
while (i--) {
selection = selections[i];
- kill(cm, selection.anchor, selection.head, ring);
+ _kill(cm, selection.anchor, selection.head, ring);
}
return true;
}
@@ -205,13 +207,6 @@
}
}
- function addPrefixMap(cm) {
- cm.state.emacsPrefixMap = true;
- cm.addKeyMap(prefixMap);
- cm.on("keyHandled", maybeRemovePrefixMap);
- cm.on("inputRead", maybeRemovePrefixMap);
- }
-
function maybeRemovePrefixMap(cm, arg) {
if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
cm.removeKeyMap(prefixMap);
@@ -222,7 +217,7 @@
// Utilities
- function setMark(cm) {
+ cmds.setMark = function (cm) {
cm.setCursor(cm.getCursor());
cm.setExtending(!cm.getExtending());
cm.on("change", function() { cm.setExtending(false); });
@@ -233,9 +228,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, ""));
}
@@ -266,145 +271,266 @@
}
}
- function quit(cm) {
+ // Commands. Names should match emacs function names (albeit in camelCase)
+ // except where emacs function names collide with code mirror core commands.
+
+ cmds.killRegion = function(cm) {
+ _kill(cm, cm.getCursor("start"), cm.getCursor("end"), true);
+ };
+
+ // Maps to emacs kill-line
+ cmds.killLineEmacs = repeated(function(cm) {
+ var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
+ var text = cm.getRange(start, end);
+ if (!/\S/.test(text)) {
+ text += "\n";
+ end = Pos(start.line + 1, 0);
+ }
+ _kill(cm, start, end, "grow", text);
+ });
+
+ cmds.killRingSave = function(cm) {
+ addToRing(cm.getSelection());
+ clearMark(cm);
+ };
+
+ cmds.yank = function(cm) {
+ var start = cm.getCursor();
+ cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
+ cm.setSelection(start, cm.getCursor());
+ };
+
+ cmds.yankPop = function(cm) {
+ cm.replaceSelection(popFromRing(), "around", "paste");
+ };
+
+ cmds.forwardChar = move(byChar, 1);
+
+ cmds.backwardChar = move(byChar, -1)
+
+ cmds.deleteChar = function(cm) { killTo(cm, byChar, 1, false); };
+
+ cmds.deleteForwardChar = function(cm) {
+ _killRegion(cm, false) || killTo(cm, byChar, 1, false);
+ };
+
+ cmds.deleteBackwardChar = function(cm) {
+ _killRegion(cm, false) || killTo(cm, byChar, -1, false);
+ };
+
+ cmds.forwardWord = move(byWord, 1);
+
+ cmds.backwardWord = move(byWord, -1);
+
+ cmds.killWord = function(cm) { killTo(cm, byWord, 1, "grow"); };
+
+ cmds.backwardKillWord = function(cm) { killTo(cm, byWord, -1, "grow"); };
+
+ cmds.nextLine = move(byLine, 1);
+
+ cmds.previousLine = move(byLine, -1);
+
+ cmds.scrollDownCommand = move(byPage, -1);
+
+ cmds.scrollUpCommand = move(byPage, 1);
+
+ cmds.backwardParagraph = move(byParagraph, -1);
+
+ cmds.forwardParagraph = move(byParagraph, 1);
+
+ cmds.backwardSentence = move(bySentence, -1);
+
+ cmds.forwardSentence = move(bySentence, 1);
+
+ cmds.killSentence = function(cm) { killTo(cm, bySentence, 1, "grow"); };
+
+ cmds.backwardKillSentence = function(cm) {
+ _kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), "grow");
+ };
+
+ cmds.killSexp = function(cm) { killTo(cm, byExpr, 1, "grow"); };
+
+ cmds.backwardKillSexp = function(cm) { killTo(cm, byExpr, -1, "grow"); };
+
+ cmds.forwardSexp = move(byExpr, 1);
+
+ cmds.backwardSexp = move(byExpr, -1);
+
+ cmds.markSexp = function(cm) {
+ var cursor = cm.getCursor();
+ cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
+ };
+
+ cmds.transposeSexps = function(cm) {
+ var leftStart = byExpr(cm, cm.getCursor(), -1);
+ var leftEnd = byExpr(cm, leftStart, 1);
+ var rightEnd = byExpr(cm, leftEnd, 1);
+ var rightStart = byExpr(cm, rightEnd, -1);
+ cm.replaceRange(cm.getRange(rightStart, rightEnd) +
+ cm.getRange(leftEnd, rightStart) +
+ cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
+ };
+
+ cmds.backwardUpList = repeated(toEnclosingExpr);
+
+ cmds.justOneSpace = function(cm) {
+ var pos = cm.getCursor(), from = pos.ch;
+ var to = pos.ch, text = cm.getLine(pos.line);
+ while (from && /\s/.test(text.charAt(from - 1))) --from;
+ while (to < text.length && /\s/.test(text.charAt(to))) ++to;
+ cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
+ };
+
+ cmds.openLine = repeated(function(cm) {
+ cm.replaceSelection("\n", "start");
+ });
+
+ // maps to emacs 'transpose-chars'
+ cmds.transposeCharsRepeatable = repeated(function(cm) {
+ cm.execCommand("transposeChars");
+ });
+
+ cmds.capitalizeWord = repeated(function(cm) {
+ operateOnWord(cm, function(w) {
+ var letter = w.search(/\w/);
+ if (letter == -1) return w;
+ return w.slice(0, letter) + w.charAt(letter).toUpperCase() +
+ w.slice(letter + 1).toLowerCase();
+ });
+ });
+
+ cmds.upcaseWord = repeated(function(cm) {
+ operateOnWord(cm, function(w) { return w.toUpperCase(); });
+ });
+
+ cmds.downcaseWord = repeated(function(cm) {
+ operateOnWord(cm, function(w) { return w.toLowerCase(); });
+ });
+
+ // maps to emacs 'undo'
+ cmds.undoRepeatable = repeated("undo");
+
+ cmds.keyboardQuit = function(cm) {
cm.execCommand("clearSearch");
clearMark(cm);
}
- CodeMirror.emacs = {kill: kill, killRegion: killRegion, repeated: repeated};
+ cmds.newline = repeated(function(cm) { cm.replaceSelection("\n", "end"); });
- // Actual keymap
+ cmds.gotoLine = function(cm) {
+ var prefix = getPrefix(cm, true);
+ if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
- var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
- "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"), true);},
- "Ctrl-K": repeated(function(cm) {
- var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
- var text = cm.getRange(start, end);
- if (!/\S/.test(text)) {
- text += "\n";
- end = Pos(start.line + 1, 0);
- }
- kill(cm, start, end, "grow", text);
- }),
- "Alt-W": function(cm) {
- addToRing(cm.getSelection());
- clearMark(cm);
- },
- "Ctrl-Y": function(cm) {
- var start = cm.getCursor();
- cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
- cm.setSelection(start, cm.getCursor());
- },
- "Alt-Y": function(cm) {cm.replaceSelection(popFromRing(), "around", "paste");},
-
- "Ctrl-Space": setMark, "Ctrl-Shift-2": setMark,
-
- "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
- "Right": move(byChar, 1), "Left": move(byChar, -1),
- "Ctrl-D": function(cm) { killTo(cm, byChar, 1, false); },
- "Delete": function(cm) { killRegion(cm, false) || killTo(cm, byChar, 1, false); },
- "Ctrl-H": function(cm) { killTo(cm, byChar, -1, false); },
- "Backspace": function(cm) { killRegion(cm, false) || killTo(cm, byChar, -1, false); },
-
- "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
- "Alt-Right": move(byWord, 1), "Alt-Left": move(byWord, -1),
- "Alt-D": function(cm) { killTo(cm, byWord, 1, "grow"); },
- "Alt-Backspace": function(cm) { killTo(cm, byWord, -1, "grow"); },
-
- "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
- "Down": move(byLine, 1), "Up": move(byLine, -1),
- "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "End": "goLineEnd", "Home": "goLineStart",
-
- "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
- "PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
-
- "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
-
- "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
- "Alt-K": function(cm) { killTo(cm, bySentence, 1, "grow"); },
-
- "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1, "grow"); },
- "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1, "grow"); },
- "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1, "grow"),
-
- "Shift-Ctrl-Alt-2": function(cm) {
- var cursor = cm.getCursor();
- cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
- },
- "Ctrl-Alt-T": function(cm) {
- var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
- var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);
- cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +
- cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
- },
- "Ctrl-Alt-U": repeated(toEnclosingExpr),
-
- "Alt-Space": function(cm) {
- var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);
- while (from && /\s/.test(text.charAt(from - 1))) --from;
- while (to < text.length && /\s/.test(text.charAt(to))) ++to;
- cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
- },
- "Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }),
- "Ctrl-T": repeated(function(cm) {
- cm.execCommand("transposeChars");
- }),
-
- "Alt-C": repeated(function(cm) {
- operateOnWord(cm, function(w) {
- var letter = w.search(/\w/);
- if (letter == -1) return w;
- return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();
- });
- }),
- "Alt-U": repeated(function(cm) {
- operateOnWord(cm, function(w) { return w.toUpperCase(); });
- }),
- "Alt-L": repeated(function(cm) {
- operateOnWord(cm, function(w) { return w.toLowerCase(); });
- }),
+ getInput(cm, "Goto line", function(str) {
+ var num;
+ if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
+ cm.setCursor(num - 1);
+ });
+ };
- "Alt-;": "toggleComment",
+ cmds.indentRigidly = function(cm) {
+ cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
+ };
+
+ cmds.exchangePointAndMark = function(cm) {
+ cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
+ };
+
+ cmds.quotedInsertTab = repeated("insertTab");
+
+ cmds.universalArgument = function addPrefixMap(cm) {
+ cm.state.emacsPrefixMap = true;
+ cm.addKeyMap(prefixMap);
+ cm.on("keyHandled", maybeRemovePrefixMap);
+ cm.on("inputRead", maybeRemovePrefixMap);
+ };
- "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
- "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
+ CodeMirror.emacs = {kill: _kill, killRegion: _killRegion, repeated: repeated};
+
+ // Actual keymap
+ var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
+ "Ctrl-W": "killRegion",
+ "Ctrl-K": "killLineEmacs",
+ "Alt-W": "killRingSave",
+ "Ctrl-Y": "yank",
+ "Alt-Y": "yankPop",
+ "Ctrl-Space": "setMark",
+ "Ctrl-Shift-2": "setMark",
+ "Ctrl-F": "forwardChar",
+ "Ctrl-B": "backwardChar",
+ "Right": "forwardChar",
+ "Left": "backwardChar",
+ "Ctrl-D": "deleteChar",
+ "Delete": "deleteForwardChar",
+ "Ctrl-H": "deleteBackwardChar",
+ "Backspace": "deleteBackwardChar",
+ "Alt-F": "forwardWord",
+ "Alt-B": "backwardWord",
+ "Alt-Right": "forwardWord",
+ "Alt-Left": "backwardWord",
+ "Alt-D": "killWord",
+ "Alt-Backspace": "backwardKillWord",
+ "Ctrl-N": "nextLine",
+ "Ctrl-P": "previousLine",
+ "Down": "nextLine",
+ "Up": "previousLine",
+ "Ctrl-A": "goLineStart",
+ "Ctrl-E": "goLineEnd",
+ "End": "goLineEnd",
+ "Home": "goLineStart",
+ "Alt-V": "scrollDownCommand",
+ "Ctrl-V": "scrollUpCommand",
+ "PageUp": "scrollDownCommand",
+ "PageDown": "scrollUpCommand",
+ "Ctrl-Up": "backwardParagraph",
+ "Ctrl-Down": "forwardParagraph",
+ "Alt-{": "backwardParagraph",
+ "Alt-}": "forwardParagraph",
+ "Alt-A": "backwardSentence",
+ "Alt-E": "forwardSentence",
+ "Alt-K": "killSentence",
+ "Ctrl-X Delete": "backwardKillSentence",
+ "Ctrl-Alt-K": "killSexp",
+ "Ctrl-Alt-Backspace": "backwardKillSexp",
+ "Ctrl-Alt-F": "forwardSexp",
+ "Ctrl-Alt-B": "backwardSexp",
+ "Shift-Ctrl-Alt-2": "markSexp",
+ "Ctrl-Alt-T": "transposeSexps",
+ "Ctrl-Alt-U": "backwardUpList",
+ "Alt-Space": "justOneSpace",
+ "Ctrl-O": "openLine",
+ "Ctrl-T": "transposeCharsRepeatable",
+ "Alt-C": "capitalizeWord",
+ "Alt-U": "upcaseWord",
+ "Alt-L": "downcaseWord",
+ "Alt-;": "toggleComment",
+ "Ctrl-/": "undoRepeatable",
+ "Shift-Ctrl--": "undoRepeatable",
+ "Ctrl-Z": "undoRepeatable",
+ "Cmd-Z": "undoRepeatable",
+ "Ctrl-X U": "undoRepeatable",
"Shift-Ctrl-Z": "redo",
- "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
- "Ctrl-S": "findPersistentNext", "Ctrl-R": "findPersistentPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
+ "Shift-Alt-,": "goDocStart",
+ "Shift-Alt-.": "goDocEnd",
+ "Ctrl-S": "findPersistentNext",
+ "Ctrl-R": "findPersistentPrev",
+ "Ctrl-G": "keyboardQuit",
+ "Shift-Alt-5": "replace",
"Alt-/": "autocomplete",
"Enter": "newlineAndIndent",
- "Ctrl-J": repeated(function(cm) { cm.replaceSelection("\n", "end"); }),
+ "Ctrl-J": "newline",
"Tab": "indentAuto",
-
- "Alt-G G": function(cm) {
- var prefix = getPrefix(cm, true);
- if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
-
- getInput(cm, "Goto line", function(str) {
- var num;
- if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
- cm.setCursor(num - 1);
- });
- },
-
- "Ctrl-X Tab": function(cm) {
- cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
- },
- "Ctrl-X Ctrl-X": function(cm) {
- cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
- },
+ "Alt-G G": "gotoLine",
+ "Ctrl-X Tab": "indentRigidly",
+ "Ctrl-X Ctrl-X": "exchangePointAndMark",
"Ctrl-X Ctrl-S": "save",
"Ctrl-X Ctrl-W": "save",
"Ctrl-X S": "saveAll",
"Ctrl-X F": "open",
- "Ctrl-X U": repeated("undo"),
"Ctrl-X K": "close",
- "Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), "grow"); },
"Ctrl-X H": "selectAll",
-
- "Ctrl-Q Tab": repeated("insertTab"),
- "Ctrl-U": addPrefixMap,
+ "Ctrl-Q Tab": "quotedInsertTab",
+ "Ctrl-U": "universalArgument",
"fallthrough": "default"
});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/keymap/sublime.js b/Mod manager/utils/QNModManager/CodeMirror/keymap/sublime.js
index 7edf172e..0c9a63e0 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/keymap/sublime.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/keymap/sublime.js
@@ -339,7 +339,7 @@
};
- function sortLines(cm, caseSensitive) {
+ function sortLines(cm, caseSensitive, direction) {
if (cm.isReadOnly()) return CodeMirror.Pass
var ranges = cm.listSelections(), toSort = [], selected;
for (var i = 0; i < ranges.length; i++) {
@@ -361,12 +361,12 @@
var start = Pos(from, 0), end = Pos(to);
var lines = cm.getRange(start, end, false);
if (caseSensitive)
- lines.sort();
+ lines.sort(function(a, b) { return a < b ? -direction : a == b ? 0 : direction; });
else
lines.sort(function(a, b) {
var au = a.toUpperCase(), bu = b.toUpperCase();
if (au != bu) { a = au; b = bu; }
- return a < b ? -1 : a == b ? 0 : 1;
+ return a < b ? -direction : a == b ? 0 : direction;
});
cm.replaceRange(lines, start, end);
if (selected) ranges.push({anchor: start, head: Pos(to + 1, 0)});
@@ -375,8 +375,10 @@
});
}
- cmds.sortLines = function(cm) { sortLines(cm, true); };
- cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false); };
+ cmds.sortLines = function(cm) { sortLines(cm, true, 1); };
+ cmds.reverseSortLines = function(cm) { sortLines(cm, true, -1); };
+ cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false, 1); };
+ cmds.reverseSortLinesInsensitive = function(cm) { sortLines(cm, false, -1); };
cmds.nextBookmark = function(cm) {
var marks = cm.state.sublimeBookmarks;
@@ -609,7 +611,9 @@
"Cmd-J": "joinLines",
"Shift-Cmd-D": "duplicateLine",
"F5": "sortLines",
+ "Shift-F5": "reverseSortLines",
"Cmd-F5": "sortLinesInsensitive",
+ "Shift-Cmd-F5": "reverseSortLinesInsensitive",
"F2": "nextBookmark",
"Shift-F2": "prevBookmark",
"Cmd-F2": "toggleBookmark",
@@ -671,7 +675,9 @@
"Ctrl-J": "joinLines",
"Shift-Ctrl-D": "duplicateLine",
"F9": "sortLines",
+ "Shift-F9": "reverseSortLines",
"Ctrl-F9": "sortLinesInsensitive",
+ "Shift-Ctrl-F9": "reverseSortLinesInsensitive",
"F2": "nextBookmark",
"Shift-F2": "prevBookmark",
"Ctrl-F2": "toggleBookmark",
diff --git a/Mod manager/utils/QNModManager/CodeMirror/keymap/vim.js b/Mod manager/utils/QNModManager/CodeMirror/keymap/vim.js
index 5a4860c6..b2da1c13 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/keymap/vim.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/keymap/vim.js
@@ -8,7 +8,7 @@
* Supported Ex commands:
* Refer to defaultExCommandMap below.
*
- * Registers: unnamed, -, a-z, A-Z, 0-9
+ * Registers: unnamed, -, ., :, /, _, a-z, A-Z, 0-9
* (Does not respect the special case for number registers when delete
* operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
* TODO: Implement the remaining registers.
@@ -44,6 +44,27 @@
})(function(CodeMirror) {
'use strict';
+ var Pos = CodeMirror.Pos;
+
+ function transformCursor(cm, range) {
+ var vim = cm.state.vim;
+ if (!vim || vim.insertMode) return range.head;
+ var head = vim.sel.head;
+ if (!head) return range.head;
+
+ if (vim.visualBlock) {
+ if (range.head.line != head.line) {
+ return;
+ }
+ }
+ if (range.from() == range.anchor && !range.empty()) {
+ if (range.head.line == head.line && range.head.ch != head.ch)
+ return new Pos(range.head.line, range.head.ch - 1);
+ }
+
+ return range.head;
+ }
+
var defaultKeymap = [
// Key to key mapping. This goes first to make it possible to override
// existing mappings.
@@ -51,6 +72,8 @@
{ keys: '', type: 'keyToKey', toKeys: 'l' },
{ keys: '', type: 'keyToKey', toKeys: 'k' },
{ keys: '', type: 'keyToKey', toKeys: 'j' },
+ { keys: 'g', type: 'keyToKey', toKeys: 'gk' },
+ { keys: 'g', type: 'keyToKey', toKeys: 'gj' },
{ keys: '', type: 'keyToKey', toKeys: 'l' },
{ keys: '', type: 'keyToKey', toKeys: 'h', context: 'normal'},
{ keys: '', type: 'keyToKey', toKeys: 'x', context: 'normal'},
@@ -73,6 +96,7 @@
{ keys: '', type: 'keyToKey', toKeys: '' },
{ keys: '', type: 'keyToKey', toKeys: '' },
{ keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' },
+ { keys: '', type: 'keyToKey', toKeys: 'i', context: 'normal'},
{ keys: '', type: 'action', action: 'toggleOverwrite', context: 'insert' },
// Motions
{ keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }},
@@ -102,6 +126,9 @@
{ keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }},
{ keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
{ keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
+ {keys: "g$", type: "motion", motion: "moveToEndOfDisplayLine"},
+ {keys: "g^", type: "motion", motion: "moveToStartOfDisplayLine"},
+ {keys: "g0", type: "motion", motion: "moveToStartOfDisplayLine"},
{ keys: '0', type: 'motion', motion: 'moveToStartOfLine' },
{ keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }},
@@ -141,6 +168,8 @@
{ keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true },
{ keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }},
{ keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }},
+ { keys: 'gn', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: true }},
+ { keys: 'gN', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: false }},
// Operator-Motion dual commands
{ keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }},
{ keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }},
@@ -152,6 +181,7 @@
{ keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'},
{ keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
{ keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
+ { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveToStartOfLine', context: 'insert' },
{ keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
//ignore C-w in normal mode
{ keys: '', type: 'idle', context: 'normal' },
@@ -242,11 +272,10 @@
{ name: 'yank', shortName: 'y' },
{ name: 'delmarks', shortName: 'delm' },
{ name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
+ { name: 'vglobal', shortName: 'v' },
{ name: 'global', shortName: 'g' }
];
- var Pos = CodeMirror.Pos;
-
var Vim = function() {
function enterVimMode(cm) {
cm.setOption('disableInput', true);
@@ -262,15 +291,13 @@
cm.off('cursorActivity', onCursorActivity);
CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
cm.state.vim = null;
+ if (highlightTimeout) clearTimeout(highlightTimeout);
}
function detachVimMap(cm, next) {
if (this == CodeMirror.keyMap.vim) {
+ cm.options.$customCursor = null;
CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
- if (cm.getOption("inputStyle") == "contenteditable" && document.body.style.caretColor != null) {
- disableFatCursorMark(cm);
- cm.getInputField().style.caretColor = "";
- }
}
if (!next || next.attach != attachVimMap)
@@ -278,57 +305,15 @@
}
function attachVimMap(cm, prev) {
if (this == CodeMirror.keyMap.vim) {
+ if (cm.curOp) cm.curOp.selectionChanged = true;
+ cm.options.$customCursor = transformCursor;
CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor");
- if (cm.getOption("inputStyle") == "contenteditable" && document.body.style.caretColor != null) {
- enableFatCursorMark(cm);
- cm.getInputField().style.caretColor = "transparent";
- }
}
if (!prev || prev.attach != attachVimMap)
enterVimMode(cm);
}
- function updateFatCursorMark(cm) {
- if (!cm.state.fatCursorMarks) return;
- clearFatCursorMark(cm);
- var ranges = cm.listSelections(), result = []
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (range.empty()) {
- var lineLength = cm.getLine(range.anchor.line).length;
- if (range.anchor.ch < lineLength) {
- result.push(cm.markText(range.anchor, Pos(range.anchor.line, range.anchor.ch + 1),
- {className: "cm-fat-cursor-mark"}));
- } else {
- result.push(cm.markText(Pos(range.anchor.line, lineLength - 1),
- Pos(range.anchor.line, lineLength),
- {className: "cm-fat-cursor-mark"}));
- }
- }
- }
- cm.state.fatCursorMarks = result;
- }
-
- function clearFatCursorMark(cm) {
- var marks = cm.state.fatCursorMarks;
- if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
- }
-
- function enableFatCursorMark(cm) {
- cm.state.fatCursorMarks = [];
- updateFatCursorMark(cm)
- cm.on("cursorActivity", updateFatCursorMark)
- }
-
- function disableFatCursorMark(cm) {
- clearFatCursorMark(cm);
- cm.off("cursorActivity", updateFatCursorMark);
- // explicitly set fatCursorMarks to null because event listener above
- // can be invoke after removing it, if off is called from operation
- cm.state.fatCursorMarks = null;
- }
-
// Deprecated, simply setting the keymap works again.
CodeMirror.defineOption('vimMode', false, function(cm, val, prev) {
if (val && cm.getOption("keyMap") != "vim")
@@ -344,14 +329,14 @@
if (!vimKey) {
return false;
}
- var cmd = CodeMirror.Vim.findKey(cm, vimKey);
+ var cmd = vimApi.findKey(cm, vimKey);
if (typeof cmd == 'function') {
CodeMirror.signal(cm, 'vim-keypress', vimKey);
}
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) == '\'') {
@@ -416,7 +401,10 @@
var lowerCaseAlphabet = makeKeyRange(97, 26);
var numbers = makeKeyRange(48, 10);
var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
- var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']);
+ var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '_', '/']);
+ var upperCaseChars;
+ try { upperCaseChars = new RegExp("^[\\p{Lu}]$", "u"); }
+ catch (_) { upperCaseChars = /^[A-Z]$/; }
function isLine(cm, line) {
return line >= cm.firstLine() && line <= cm.lastLine();
@@ -431,7 +419,7 @@
return numberRegex.test(k);
}
function isUpperCase(k) {
- return (/^[A-Z]$/).test(k);
+ return upperCaseChars.test(k);
}
function isWhiteSpaceString(k) {
return (/^\s*$/).test(k);
@@ -655,7 +643,7 @@
this.latestRegister = registerName;
if (cm.openDialog) {
this.onRecordingDone = cm.openDialog(
- '(recording)['+registerName+']', null, {bottom:true});
+ document.createTextNode('(recording)['+registerName+']'), null, {bottom:true});
}
this.isRecording = true;
}
@@ -685,8 +673,6 @@
// executed in between.
lastMotion: null,
marks: {},
- // Mark for rendering fake cursor for visual mode.
- fakeCursor: null,
insertMode: false,
// Repeat count for changes made in insert mode, triggered by key
// sequences like 3,i. Only exists when insertMode is true.
@@ -735,7 +721,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;
},
@@ -758,7 +744,7 @@
exCommandDispatcher.map(lhs, rhs, ctx);
},
unmap: function(lhs, ctx) {
- exCommandDispatcher.unmap(lhs, ctx);
+ return exCommandDispatcher.unmap(lhs, ctx);
},
// Non-recursive map function.
// NOTE: This will not create mappings to key maps that aren't present
@@ -879,13 +865,17 @@
}
function handleEsc() {
if (key == '') {
- // Clear input state and get back to normal mode.
- clearInputState(cm);
if (vim.visualMode) {
+ // Get back to normal mode.
exitVisualMode(cm);
} else if (vim.insertMode) {
+ // Get back to normal mode.
exitInsertMode(cm);
+ } else {
+ // We're already in normal mode. Let '' be handled normally.
+ return;
}
+ clearInputState(cm);
return true;
}
}
@@ -898,7 +888,7 @@
match = (/<\w+-.+?>|<\w+>|./).exec(keys);
key = match[0];
keys = keys.substring(match.index + key.length);
- CodeMirror.Vim.handleKey(cm, key, 'mapping');
+ vimApi.handleKey(cm, key, 'mapping');
}
}
@@ -945,7 +935,12 @@
if (!keysMatcher) { clearInputState(cm); return false; }
var context = vim.visualMode ? 'visual' :
'normal';
- var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context);
+ var mainKey = keysMatcher[2] || keysMatcher[1];
+ if (vim.inputState.operatorShortcut && vim.inputState.operatorShortcut.slice(-1) == mainKey) {
+ // multikey operators act linewise by repeating only the last character
+ mainKey = vim.inputState.operatorShortcut;
+ }
+ var match = commandDispatcher.matchCommand(mainKey, defaultKeymap, vim.inputState, context);
if (match.type == 'none') { clearInputState(cm); return false; }
else if (match.type == 'partial') { return true; }
@@ -981,7 +976,7 @@
// clear VIM state in case it's in a bad state.
cm.state.vim = undefined;
maybeInitVimState(cm);
- if (!CodeMirror.Vim.suppressErrorLogging) {
+ if (!vimApi.suppressErrorLogging) {
console['log'](e);
}
throw e;
@@ -1128,6 +1123,8 @@
}
RegisterController.prototype = {
pushText: function(registerName, operator, text, linewise, blockwise) {
+ // The black hole register, "_, means delete/yank to nowhere.
+ if (registerName === '_') return;
if (linewise && text.charAt(text.length - 1) !== '\n'){
text += '\n';
}
@@ -1303,6 +1300,9 @@
}
inputState.operator = command.operator;
inputState.operatorArgs = copyArgs(command.operatorArgs);
+ if (command.keys.length > 1) {
+ inputState.operatorShortcut = command.keys;
+ }
if (command.exitVisualBlock) {
vim.visualBlock = false;
updateCmSelection(cm);
@@ -1446,7 +1446,7 @@
showPrompt(cm, {
onClose: onPromptClose,
prefix: promptPrefix,
- desc: searchPromptDesc,
+ desc: '(JavaScript regexp)',
onKeyUp: onPromptKeyUp,
onKeyDown: onPromptKeyDown
});
@@ -1574,7 +1574,7 @@
motionArgs.repeat = repeat;
clearInputState(cm);
if (motion) {
- var motionResult = motions[motion](cm, origHead, motionArgs, vim);
+ var motionResult = motions[motion](cm, origHead, motionArgs, vim, inputState);
vim.lastMotion = motions[motion];
if (!motionResult) {
return;
@@ -1631,17 +1631,17 @@
var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch);
if (lastSel.visualLine) {
// Linewise Visual mode: The same number of lines.
- newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
+ newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
} else if (lastSel.visualBlock) {
// Blockwise Visual mode: The same number of lines and columns.
- newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);
+ newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);
} else if (lastSel.head.line == lastSel.anchor.line) {
// Normal Visual mode within one line: The same number of characters.
- newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset);
+ newHead = new Pos(oldAnchor.line, oldAnchor.ch + chOffset);
} else {
// Normal Visual mode with several lines: The same number of lines, in the
// last line the same number of characters as in the last line the last time.
- newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
+ newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
}
vim.visualMode = true;
vim.visualLine = lastSel.visualLine;
@@ -1681,7 +1681,7 @@
ranges[i].head.ch = lineLength(cm, ranges[i].head.line);
}
} else if (mode == 'line') {
- ranges[0].head = Pos(ranges[0].head.line + 1, 0);
+ ranges[0].head = new Pos(ranges[0].head.line + 1, 0);
}
}
} else {
@@ -1743,22 +1743,22 @@
var motions = {
moveToTopLine: function(cm, _head, motionArgs) {
var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;
- return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+ return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
moveToMiddleLine: function(cm) {
var range = getUserVisibleLines(cm);
var line = Math.floor((range.top + range.bottom) * 0.5);
- return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+ return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
moveToBottomLine: function(cm, _head, motionArgs) {
var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
- return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+ return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
expandToLine: function(_cm, head, motionArgs) {
// Expands forward to end of line, and then to next line if repeat is
// >1. Does not handle backward motion!
var cur = head;
- return Pos(cur.line + motionArgs.repeat - 1, Infinity);
+ return new Pos(cur.line + motionArgs.repeat - 1, Infinity);
},
findNext: function(cm, _head, motionArgs) {
var state = getSearchState(cm);
@@ -1772,6 +1772,87 @@
highlightSearchMatches(cm, query);
return findNext(cm, prev/** prev */, query, motionArgs.repeat);
},
+ /**
+ * Find and select the next occurrence of the search query. If the cursor is currently
+ * within a match, then find and select the current match. Otherwise, find the next occurrence in the
+ * appropriate direction.
+ *
+ * This differs from `findNext` in the following ways:
+ *
+ * 1. Instead of only returning the "from", this returns a "from", "to" range.
+ * 2. If the cursor is currently inside a search match, this selects the current match
+ * instead of the next match.
+ * 3. If there is no associated operator, this will turn on visual mode.
+ */
+ findAndSelectNextInclusive: function(cm, _head, motionArgs, vim, prevInputState) {
+ var state = getSearchState(cm);
+ var query = state.getQuery();
+
+ if (!query) {
+ return;
+ }
+
+ var prev = !motionArgs.forward;
+ prev = (state.isReversed()) ? !prev : prev;
+
+ // next: [from, to] | null
+ var next = findNextFromAndToInclusive(cm, prev, query, motionArgs.repeat, vim);
+
+ // No matches.
+ if (!next) {
+ return;
+ }
+
+ // If there's an operator that will be executed, return the selection.
+ if (prevInputState.operator) {
+ return next;
+ }
+
+ // At this point, we know that there is no accompanying operator -- let's
+ // deal with visual mode in order to select an appropriate match.
+
+ var from = next[0];
+ // For whatever reason, when we use the "to" as returned by searchcursor.js directly,
+ // the resulting selection is extended by 1 char. Let's shrink it so that only the
+ // match is selected.
+ var to = new Pos(next[1].line, next[1].ch - 1);
+
+ if (vim.visualMode) {
+ // If we were in visualLine or visualBlock mode, get out of it.
+ if (vim.visualLine || vim.visualBlock) {
+ vim.visualLine = false;
+ vim.visualBlock = false;
+ CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: ""});
+ }
+
+ // If we're currently in visual mode, we should extend the selection to include
+ // the search result.
+ var anchor = vim.sel.anchor;
+ if (anchor) {
+ if (state.isReversed()) {
+ if (motionArgs.forward) {
+ return [anchor, from];
+ }
+
+ return [anchor, to];
+ } else {
+ if (motionArgs.forward) {
+ return [anchor, to];
+ }
+
+ return [anchor, from];
+ }
+ }
+ } else {
+ // Let's turn visual mode on.
+ vim.visualMode = true;
+ vim.visualLine = false;
+ vim.visualBlock = false;
+ CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: ""});
+ }
+
+ return prev ? [to, from] : [from, to];
+ },
goToMark: function(cm, _head, motionArgs, vim) {
var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
if (pos) {
@@ -1783,8 +1864,8 @@
if (vim.visualBlock && motionArgs.sameLine) {
var sel = vim.sel;
return [
- clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)),
- clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch))
+ clipCursorToContent(cm, new Pos(sel.anchor.line, sel.head.ch)),
+ clipCursorToContent(cm, new Pos(sel.head.line, sel.anchor.ch))
];
} else {
return ([vim.sel.head, vim.sel.anchor]);
@@ -1824,7 +1905,7 @@
// Vim places the cursor on the first non-whitespace character of
// the line if there is one, else it places the cursor at the end
// of the line, regardless of whether a mark was found.
- best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
+ best = new Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
}
return best;
},
@@ -1832,7 +1913,7 @@
var cur = head;
var repeat = motionArgs.repeat;
var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
- return Pos(cur.line, ch);
+ return new Pos(cur.line, ch);
},
moveByLines: function(cm, head, motionArgs, vim) {
var cur = head;
@@ -1867,15 +1948,15 @@
// move to previous/next line is triggered.
if (line < first && cur.line == first){
return this.moveToStartOfLine(cm, head, motionArgs, vim);
- }else if (line > last && cur.line == last){
- return this.moveToEol(cm, head, motionArgs, vim, true);
+ } else if (line > last && cur.line == last){
+ return moveToEol(cm, head, motionArgs, vim, true);
}
if (motionArgs.toFirstChar){
endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
vim.lastHPos = endCh;
}
- vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left;
- return Pos(line, endCh);
+ vim.lastHSPos = cm.charCoords(new Pos(line, endCh),'div').left;
+ return new Pos(line, endCh);
},
moveByDisplayLines: function(cm, head, motionArgs, vim) {
var cur = head;
@@ -1897,7 +1978,7 @@
var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
var res = cm.coordsChar(goalCoords, 'div');
} else {
- var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div');
+ var resCoords = cm.charCoords(new Pos(cm.firstLine(), 0), 'div');
resCoords.left = vim.lastHSPos;
res = cm.coordsChar(resCoords, 'div');
}
@@ -1970,22 +2051,14 @@
vim.lastHSPos = cm.charCoords(head,'div').left;
return moveToColumn(cm, repeat);
},
- moveToEol: function(cm, head, motionArgs, vim, keepHPos) {
- var cur = head;
- var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
- var end=cm.clipPos(retval);
- end.ch--;
- if (!keepHPos) {
- vim.lastHPos = Infinity;
- vim.lastHSPos = cm.charCoords(end,'div').left;
- }
- return retval;
+ moveToEol: function(cm, head, motionArgs, vim) {
+ return moveToEol(cm, head, motionArgs, vim, false);
},
moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
// Go to the start of the line where the text begins, or the end for
// whitespace-only lines
var cursor = head;
- return Pos(cursor.line,
+ return new Pos(cursor.line,
findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));
},
moveToMatchedSymbol: function(cm, head) {
@@ -1997,7 +2070,7 @@
for (; ch < lineText.length; ch++) {
symbol = lineText.charAt(ch);
if (symbol && isMatchableSymbol(symbol)) {
- var style = cm.getTokenTypeAt(Pos(line, ch + 1));
+ var style = cm.getTokenTypeAt(new Pos(line, ch + 1));
if (style !== "string" && style !== "comment") {
break;
}
@@ -2006,23 +2079,33 @@
if (ch < lineText.length) {
// Only include angle brackets in analysis if they are being matched.
var re = (ch === '<' || ch === '>') ? /[(){}[\]<>]/ : /[(){}[\]]/;
- var matched = cm.findMatchingBracket(Pos(line, ch), {bracketRegex: re});
+ var matched = cm.findMatchingBracket(new Pos(line, ch), {bracketRegex: re});
return matched.to;
} else {
return cursor;
}
},
moveToStartOfLine: function(_cm, head) {
- return Pos(head.line, 0);
+ return new Pos(head.line, 0);
},
moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) {
var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
if (motionArgs.repeatIsExplicit) {
lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
}
- return Pos(lineNum,
+ return new Pos(lineNum,
findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
},
+ moveToStartOfDisplayLine: function(cm) {
+ cm.execCommand("goLineLeft");
+ return cm.getCursor();
+ },
+ moveToEndOfDisplayLine: function(cm) {
+ cm.execCommand("goLineRight");
+ var head = cm.getCursor();
+ if (head.sticky == "before") head.ch--;
+ return head;
+ },
textObjectManipulation: function(cm, head, motionArgs, vim) {
// TODO: lots of possible exceptions that can be thrown here. Try da(
// outside of a () block.
@@ -2183,7 +2266,7 @@
if (anchor.line == cm.firstLine()) {
anchor.ch = 0;
} else {
- anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));
+ anchor = new Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));
}
}
text = cm.getRange(anchor, head);
@@ -2196,7 +2279,7 @@
text = cm.getSelection();
var replacement = fillArray('', ranges.length);
cm.replaceSelections(replacement);
- finalHead = ranges[0].anchor;
+ finalHead = cursorMin(ranges[0].head, ranges[0].anchor);
}
vimGlobalState.registerController.pushText(
args.registerName, 'delete', text,
@@ -2330,7 +2413,7 @@
},
scrollToCursor: function(cm, actionArgs) {
var lineNum = cm.getCursor().line;
- var charCoords = cm.charCoords(Pos(lineNum, 0), 'local');
+ var charCoords = cm.charCoords(new Pos(lineNum, 0), 'local');
var height = cm.getScrollInfo().clientHeight;
var y = charCoords.top;
var lineHeight = charCoords.bottom - y;
@@ -2382,9 +2465,9 @@
var head = actionArgs.head || cm.getCursor('head');
var height = cm.listSelections().length;
if (insertAt == 'eol') {
- head = Pos(head.line, lineLength(cm, head.line));
+ head = new Pos(head.line, lineLength(cm, head.line));
} else if (insertAt == 'bol') {
- head = Pos(head.line, 0);
+ head = new Pos(head.line, 0);
} else if (insertAt == 'charAfter') {
head = offsetCursor(head, 0, 1);
} else if (insertAt == 'firstNonBlank') {
@@ -2396,10 +2479,10 @@
if (sel.head.line < sel.anchor.line) {
head = sel.head;
} else {
- head = Pos(sel.anchor.line, 0);
+ head = new Pos(sel.anchor.line, 0);
}
} else {
- head = Pos(
+ head = new Pos(
Math.min(sel.head.line, sel.anchor.line),
Math.min(sel.head.ch, sel.anchor.ch));
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
@@ -2411,12 +2494,12 @@
if (sel.head.line >= sel.anchor.line) {
head = offsetCursor(sel.head, 0, 1);
} else {
- head = Pos(sel.anchor.line, 0);
+ head = new Pos(sel.anchor.line, 0);
}
} else {
- head = Pos(
+ head = new Pos(
Math.min(sel.head.line, sel.anchor.line),
- Math.max(sel.head.ch + 1, sel.anchor.ch));
+ Math.max(sel.head.ch, sel.anchor.ch) + 1);
height = Math.abs(sel.head.line - sel.anchor.line) + 1;
}
} else if (insertAt == 'inplace') {
@@ -2460,7 +2543,7 @@
vim.visualLine = !!actionArgs.linewise;
vim.visualBlock = !!actionArgs.blockwise;
head = clipCursorToContent(
- cm, Pos(anchor.line, anchor.ch + repeat - 1));
+ cm, new Pos(anchor.line, anchor.ch + repeat - 1));
vim.sel = {
anchor: anchor,
head: head
@@ -2523,13 +2606,13 @@
// Repeat is the number of lines to join. Minimum 2 lines.
var repeat = Math.max(actionArgs.repeat, 2);
curStart = cm.getCursor();
- curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1,
+ curEnd = clipCursorToContent(cm, new Pos(curStart.line + repeat - 1,
Infinity));
}
var finalCh = 0;
for (var i = curStart.line; i < curEnd.line; i++) {
finalCh = lineLength(cm, curStart.line);
- var tmp = Pos(curStart.line + 1,
+ var tmp = new Pos(curStart.line + 1,
lineLength(cm, curStart.line + 1));
var text = cm.getRange(curStart, tmp);
text = actionArgs.keepSpaces
@@ -2537,7 +2620,7 @@
: text.replace(/\n\s*/g, ' ');
cm.replaceRange(text, curStart, tmp);
}
- var curFinalPos = Pos(curStart.line, finalCh);
+ var curFinalPos = new Pos(curStart.line, finalCh);
if (vim.visualMode) {
exitVisualMode(cm, false);
}
@@ -2548,7 +2631,7 @@
var insertAt = copyCursor(cm.getCursor());
if (insertAt.line === cm.firstLine() && !actionArgs.after) {
// Special case for inserting newline before start of document.
- cm.replaceRange('\n', Pos(cm.firstLine(), 0));
+ cm.replaceRange('\n', new Pos(cm.firstLine(), 0));
cm.setCursor(cm.firstLine(), 0);
} else {
insertAt.line = (actionArgs.after) ? insertAt.line :
@@ -2649,7 +2732,7 @@
// first delete the selected text
cm.replaceSelections(emptyStrings);
// Set new selections as per the block length of the yanked text
- selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch);
+ selectionEnd = new Pos(selectionStart.line + text.length-1, selectionStart.ch);
cm.setCursor(selectionStart);
selectBlock(cm, selectionEnd);
cm.replaceSelections(text);
@@ -2676,7 +2759,7 @@
for (var i = 0; i < text.length; i++) {
var line = cur.line+i;
if (line > cm.lastLine()) {
- cm.replaceRange('\n', Pos(line, 0));
+ cm.replaceRange('\n', new Pos(line, 0));
}
var lastCh = lineLength(cm, line);
if (lastCh < cur.ch) {
@@ -2684,18 +2767,18 @@
}
}
cm.setCursor(cur);
- selectBlock(cm, Pos(cur.line + text.length-1, cur.ch));
+ selectBlock(cm, new Pos(cur.line + text.length-1, cur.ch));
cm.replaceSelections(text);
curPosFinal = cur;
} else {
cm.replaceRange(text, cur);
// Now fine tune the cursor to where we want it.
if (linewise && actionArgs.after) {
- curPosFinal = Pos(
+ curPosFinal = new Pos(
cur.line + 1,
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));
} else if (linewise && !actionArgs.after) {
- curPosFinal = Pos(
+ curPosFinal = new Pos(
cur.line,
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));
} else if (!linewise && actionArgs.after) {
@@ -2743,7 +2826,7 @@
if (replaceTo > line.length) {
replaceTo=line.length;
}
- curEnd = Pos(curStart.line, replaceTo);
+ curEnd = new Pos(curStart.line, replaceTo);
}
if (replaceWith=='\n') {
if (!vim.visualMode) cm.replaceRange('', curStart, curEnd);
@@ -2799,13 +2882,13 @@
} else {
numberStr = baseStr + zeroPadding + numberStr;
}
- var from = Pos(cur.line, start);
- var to = Pos(cur.line, end);
+ var from = new Pos(cur.line, start);
+ var to = new Pos(cur.line, end);
cm.replaceRange(numberStr, from, to);
} else {
return;
}
- cm.setCursor(Pos(cur.line, start + numberStr.length - 1));
+ cm.setCursor(new Pos(cur.line, start + numberStr.length - 1));
},
repeatLastEdit: function(cm, actionArgs, vim) {
var lastEditInputState = vim.lastEditInputState;
@@ -2842,7 +2925,7 @@
var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
var maxCh = lineLength(cm, line) - 1 + !!includeLineBreak;
var ch = Math.min(Math.max(0, cur.ch), maxCh);
- return Pos(line, ch);
+ return new Pos(line, ch);
}
function copyArgs(args) {
var ret = {};
@@ -2858,7 +2941,7 @@
offsetCh = offsetLine.ch;
offsetLine = offsetLine.line;
}
- return Pos(cur.line + offsetLine, cur.ch + offsetCh);
+ return new Pos(cur.line + offsetLine, cur.ch + offsetCh);
}
function commandMatches(keys, keyMap, context, inputState) {
// Partial matches are not applied. They inform the key handler
@@ -2918,7 +3001,7 @@
};
}
function copyCursor(cur) {
- return Pos(cur.line, cur.ch);
+ return new Pos(cur.line, cur.ch);
}
function cursorEqual(cur1, cur2) {
return cur1.ch == cur2.ch && cur1.line == cur2.line;
@@ -2965,7 +3048,7 @@
function extendLineToColumn(cm, lineNum, column) {
var endCh = lineLength(cm, lineNum);
var spaces = new Array(column-endCh+1).join(' ');
- cm.setCursor(Pos(lineNum, endCh));
+ cm.setCursor(new Pos(lineNum, endCh));
cm.replaceRange(spaces, cm.getCursor());
}
// This functions selects a rectangular block
@@ -3046,13 +3129,13 @@
if (block) {
var width = block.width;
var height = block.height;
- selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width);
+ selectionEnd = new Pos(selectionStart.line + height, selectionStart.ch + width);
var selections = [];
// selectBlock creates a 'proper' rectangular block.
// We do not want that in all cases, so we manually set selections.
for (var i = selectionStart.line; i < selectionEnd.line; i++) {
- var anchor = Pos(i, selectionStart.ch);
- var head = Pos(i, selectionEnd.ch);
+ var anchor = new Pos(i, selectionStart.ch);
+ var head = new Pos(i, selectionEnd.ch);
var range = {anchor: anchor, head: head};
selections.push(range);
}
@@ -3064,8 +3147,8 @@
var ch = end.ch - start.ch;
selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch};
if (lastSelection.visualLine) {
- selectionStart = Pos(selectionStart.line, 0);
- selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));
+ selectionStart = new Pos(selectionStart.line, 0);
+ selectionEnd = new Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));
}
cm.setSelection(selectionStart, selectionEnd);
}
@@ -3114,7 +3197,7 @@
head = cursorMax(head, end);
head = offsetCursor(head, 0, -1);
if (head.ch == -1 && head.line != cm.firstLine()) {
- head = Pos(head.line - 1, lineLength(cm, head.line - 1));
+ head = new Pos(head.line - 1, lineLength(cm, head.line - 1));
}
}
return [anchor, head];
@@ -3130,7 +3213,6 @@
vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';
var cmSel = makeCmSelection(cm, sel, mode);
cm.setSelections(cmSel.ranges, cmSel.primary);
- updateFakeCursor(cm);
}
function makeCmSelection(cm, sel, mode, exclusive) {
var head = copyCursor(sel.head);
@@ -3163,16 +3245,18 @@
};
} else if (mode == 'block') {
var top = Math.min(anchor.line, head.line),
- left = Math.min(anchor.ch, head.ch),
+ fromCh = anchor.ch,
bottom = Math.max(anchor.line, head.line),
- right = Math.max(anchor.ch, head.ch) + 1;
+ toCh = head.ch;
+ if (fromCh < toCh) { toCh += 1 }
+ else { fromCh += 1 };
var height = bottom - top + 1;
var primary = head.line == top ? 0 : height - 1;
var ranges = [];
for (var i = 0; i < height; i++) {
ranges.push({
- anchor: Pos(top + i, left),
- head: Pos(top + i, right)
+ anchor: new Pos(top + i, fromCh),
+ head: new Pos(top + i, toCh)
});
}
return {
@@ -3206,7 +3290,6 @@
vim.visualLine = false;
vim.visualBlock = false;
if (!vim.insertMode) CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
- clearFakeCursor(vim);
}
// Remove any trailing newlines from the selection. For
@@ -3294,7 +3377,7 @@
if (!start) { start = wordStart; }
}
}
- return { start: Pos(cur.line, start), end: Pos(cur.line, end) };
+ return { start: new Pos(cur.line, start), end: new Pos(cur.line, end) };
}
/**
@@ -3406,7 +3489,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;
@@ -3468,7 +3551,7 @@
}
}
if (state.nextCh || state.curMoveThrough) {
- return Pos(line, state.index);
+ return new Pos(line, state.index);
}
return cur;
}
@@ -3580,7 +3663,7 @@
break;
}
words.push(word);
- cur = Pos(word.line, forward ? (word.to - 1) : word.from);
+ cur = new Pos(word.line, forward ? (word.to - 1) : word.from);
}
var shortCircuit = words.length != repeat;
var firstWord = words[0];
@@ -3591,22 +3674,34 @@
// We did not start in the middle of a word. Discard the extra word at the end.
lastWord = words.pop();
}
- return Pos(lastWord.line, lastWord.from);
+ return new Pos(lastWord.line, lastWord.from);
} else if (forward && wordEnd) {
- return Pos(lastWord.line, lastWord.to - 1);
+ return new Pos(lastWord.line, lastWord.to - 1);
} else if (!forward && wordEnd) {
// ge
if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
// We did not start in the middle of a word. Discard the extra word at the end.
lastWord = words.pop();
}
- return Pos(lastWord.line, lastWord.to);
+ return new Pos(lastWord.line, lastWord.to);
} else {
// b
- return Pos(lastWord.line, lastWord.from);
+ return new Pos(lastWord.line, lastWord.from);
}
}
+ function moveToEol(cm, head, motionArgs, vim, keepHPos) {
+ var cur = head;
+ var retval= new Pos(cur.line + motionArgs.repeat - 1, Infinity);
+ var end=cm.clipPos(retval);
+ end.ch--;
+ if (!keepHPos) {
+ vim.lastHPos = Infinity;
+ vim.lastHSPos = cm.charCoords(end,'div').left;
+ }
+ return retval;
+ }
+
function moveToCharacter(cm, repeat, forward, character) {
var cur = cm.getCursor();
var start = cur.ch;
@@ -3619,14 +3714,14 @@
}
start = idx;
}
- return Pos(cm.getCursor().line, idx);
+ return new Pos(cm.getCursor().line, idx);
}
function moveToColumn(cm, repeat) {
// repeat is always >= 1, so repeat - 1 always corresponds
// to the column we want to go to.
var line = cm.getCursor().line;
- return clipCursorToContent(cm, Pos(line, repeat - 1));
+ return clipCursorToContent(cm, new Pos(line, repeat - 1));
}
function updateMark(cm, vim, markName, pos) {
@@ -3878,7 +3973,7 @@
repeat--;
}
- return Pos(curr_index.ln, curr_index.pos);
+ return new Pos(curr_index.ln, curr_index.pos);
}
// TODO: perhaps this finagling of start and end positions belongs
@@ -3901,8 +3996,8 @@
// cursor is on a matching open bracket.
var offset = curChar === openSym ? 1 : 0;
- start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, undefined, {'bracketRegex': bracketRegexp});
- end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, undefined, {'bracketRegex': bracketRegexp});
+ start = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), -1, undefined, {'bracketRegex': bracketRegexp});
+ end = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), 1, undefined, {'bracketRegex': bracketRegexp});
if (!start || !end) {
return { start: cur, end: cur };
@@ -3983,8 +4078,8 @@
}
return {
- start: Pos(cur.line, start),
- end: Pos(cur.line, end)
+ start: new Pos(cur.line, start),
+ end: new Pos(cur.line, end)
};
}
@@ -4021,16 +4116,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, '/');
}
@@ -4214,31 +4299,69 @@
ignoreCase = (/^[^A-Z]*$/).test(regexPart);
}
var regexp = new RegExp(regexPart,
- (ignoreCase || forceIgnoreCase) ? 'i' : undefined);
+ (ignoreCase || forceIgnoreCase) ? 'im' : 'm');
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', class: 'cm-vim-message'}, 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 {
+ var shortText = '';
+ if (typeof options.prefix != "string" && options.prefix) shortText += options.prefix.textContent;
+ if (options.desc) shortText += " " + options.desc;
+ options.onClose(prompt(shortText, ''));
+ }
}
+
function regexEqual(r1, r2) {
if (r1 instanceof RegExp && r2 instanceof RegExp) {
var props = ['global', 'multiline', 'ignoreCase', 'source'];
@@ -4309,6 +4432,7 @@
function highlightSearchMatches(cm, query) {
clearTimeout(highlightTimeout);
highlightTimeout = setTimeout(function() {
+ if (!cm.state.vim) return;
var searchState = getSearchState(cm);
var overlay = searchState.getOverlay();
if (!overlay || query != overlay.query) {
@@ -4334,12 +4458,19 @@
var cursor = cm.getSearchCursor(query, pos);
for (var i = 0; i < repeat; i++) {
var found = cursor.find(prev);
- if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }
+ if (i == 0 && found && cursorEqual(cursor.from(), pos)) {
+ var lastEndPos = prev ? cursor.from() : cursor.to();
+ found = cursor.find(prev);
+ if (found && !found[0] && cursorEqual(cursor.from(), lastEndPos)) {
+ if (cm.getLine(lastEndPos.line).length == lastEndPos.ch)
+ found = cursor.find(prev);
+ }
+ }
if (!found) {
// SearchCursor may have returned null because it hit EOF, wrap
// around and try again.
cursor = cm.getSearchCursor(query,
- (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
+ (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0) );
if (!cursor.find(prev)) {
return;
}
@@ -4348,6 +4479,42 @@
return cursor.from();
});
}
+ /**
+ * Pretty much the same as `findNext`, except for the following differences:
+ *
+ * 1. Before starting the search, move to the previous search. This way if our cursor is
+ * already inside a match, we should return the current match.
+ * 2. Rather than only returning the cursor's from, we return the cursor's from and to as a tuple.
+ */
+ function findNextFromAndToInclusive(cm, prev, query, repeat, vim) {
+ if (repeat === undefined) { repeat = 1; }
+ return cm.operation(function() {
+ var pos = cm.getCursor();
+ var cursor = cm.getSearchCursor(query, pos);
+
+ // Go back one result to ensure that if the cursor is currently a match, we keep it.
+ var found = cursor.find(!prev);
+
+ // If we haven't moved, go back one more (similar to if i==0 logic in findNext).
+ if (!vim.visualMode && found && cursorEqual(cursor.from(), pos)) {
+ cursor.find(!prev);
+ }
+
+ for (var i = 0; i < repeat; i++) {
+ found = cursor.find(prev);
+ if (!found) {
+ // SearchCursor may have returned null because it hit EOF, wrap
+ // around and try again.
+ cursor = cm.getSearchCursor(query,
+ (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0) );
+ if (!cursor.find(prev)) {
+ return;
+ }
+ }
+ }
+ return [cursor.from(), cursor.to()];
+ });
+ }
function clearSearchHighlight(cm) {
var state = getSearchState(cm);
cm.removeOverlay(getSearchState(cm).getOverlay());
@@ -4376,7 +4543,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;
@@ -4395,7 +4562,7 @@
function getMarkPos(cm, vim, markName) {
if (markName == '\'' || markName == '`') {
- return vimGlobalState.jumpList.find(cm, -1) || Pos(0, 0);
+ return vimGlobalState.jumpList.find(cm, -1) || new Pos(0, 0);
} else if (markName == '.') {
return getLastEditPos(cm);
}
@@ -4439,7 +4606,7 @@
try {
this.parseInput_(cm, inputStream, params);
} catch(e) {
- showConfirm(cm, e);
+ showConfirm(cm, e.toString());
throw e;
}
var command;
@@ -4460,7 +4627,7 @@
if (command.type == 'exToKey') {
// Handle Ex to Key mapping.
for (var i = 0; i < command.toKeys.length; i++) {
- CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping');
+ vimApi.handleKey(cm, command.toKeys[i], 'mapping');
}
return;
} else if (command.type == 'exToEx') {
@@ -4483,7 +4650,7 @@
params.callback();
}
} catch(e) {
- showConfirm(cm, e);
+ showConfirm(cm, e.toString());
throw e;
}
},
@@ -4635,7 +4802,7 @@
var commandName = lhs.substring(1);
if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {
delete this.commandMap_[commandName];
- return;
+ return true;
}
} else {
// Key to Ex or key to key mapping
@@ -4644,11 +4811,10 @@
if (keys == defaultKeymap[i].keys
&& defaultKeymap[i].context === ctx) {
defaultKeymap.splice(i, 1);
- return;
+ return true;
}
}
}
- throw Error('No such mapping.');
}
};
@@ -4675,13 +4841,11 @@
vmap: function(cm, params) { this.map(cm, params, 'visual'); },
unmap: function(cm, params, ctx) {
var mapArgs = params.args;
- if (!mapArgs || mapArgs.length < 1) {
+ if (!mapArgs || mapArgs.length < 1 || !exCommandDispatcher.unmap(mapArgs[0], ctx)) {
if (cm) {
showConfirm(cm, 'No such mapping: ' + params.input);
}
- return;
}
- exCommandDispatcher.unmap(mapArgs[0], ctx);
},
move: function(cm, params) {
commandDispatcher.processCommand(cm, cm.state.vim, {
@@ -4755,12 +4919,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 {
@@ -4772,7 +4936,7 @@
continue;
}
var register = registers[registerName] || new Register();
- regInfo += '"' + registerName + ' ' + register.toString() + ' ';
+ regInfo += '"' + registerName + ' ' + register.toString() + '\n'
}
}
showConfirm(cm, regInfo);
@@ -4809,8 +4973,8 @@
var lineStart = params.line || cm.firstLine();
var lineEnd = params.lineEnd || params.line || cm.lastLine();
if (lineStart == lineEnd) { return; }
- var curStart = Pos(lineStart, 0);
- var curEnd = Pos(lineEnd, lineLength(cm, lineEnd));
+ var curStart = new Pos(lineStart, 0);
+ var curEnd = new Pos(lineEnd, lineLength(cm, lineEnd));
var text = cm.getRange(curStart, curEnd).split('\n');
var numberRegex = pattern ? pattern :
(number == 'decimal') ? /(-?)([\d]+)/ :
@@ -4867,6 +5031,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]
@@ -4876,6 +5044,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();
@@ -4900,28 +5069,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();
},
@@ -4941,10 +5115,6 @@
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 (replacePart !== undefined) {
if (getOption('pcre')) {
replacePart = unescapeRegexReplace(replacePart.replace(/([^\\])&/g,"$1$$&"));
@@ -4972,11 +5142,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;
@@ -5012,7 +5180,7 @@
lineStart = lineEnd;
lineEnd = lineStart + count - 1;
}
- var startPos = clipCursorToContent(cm, Pos(lineStart, 0));
+ var startPos = clipCursorToContent(cm, new Pos(lineStart, 0));
var cursor = cm.getSearchCursor(query, startPos);
doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback);
},
@@ -5109,7 +5277,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,
@@ -5117,7 +5285,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) {
@@ -5130,14 +5298,26 @@
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 findNextValidMatch() {
+ var lastMatchTo = lastPos && copyCursor(searchCursor.to());
+ var match = searchCursor.findNext();
+ if (match && !match[0] && lastMatchTo && cursorEqual(searchCursor.from(), lastMatchTo)) {
+ match = searchCursor.findNext();
+ }
+ return match;
}
function next() {
// The below only loops to skip over multiple occurrences on the same
// line when 'global' is not true.
- while(searchCursor.findNext() &&
+ while(findNextValidMatch() &&
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);
@@ -5202,7 +5382,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
});
}
@@ -5300,7 +5480,7 @@
match = (/<\w+-.+?>|<\w+>|./).exec(text);
key = match[0];
text = text.substring(match.index + key.length);
- CodeMirror.Vim.handleKey(cm, key, 'macro');
+ vimApi.handleKey(cm, key, 'macro');
if (vim.insertMode) {
var changes = register.insertModeChanges[imc++].changes;
vimGlobalState.macroModeState.lastInsertModeChanges.changes =
@@ -5395,38 +5575,6 @@
} else if (!cm.curOp.isVimOp) {
handleExternalSelection(cm, vim);
}
- if (vim.visualMode) {
- updateFakeCursor(cm);
- }
- }
- /**
- * Keeps track of a fake cursor to support visual mode cursor behavior.
- */
- function updateFakeCursor(cm) {
- var className = 'cm-animate-fat-cursor';
- var vim = cm.state.vim;
- var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
- var to = offsetCursor(from, 0, 1);
- 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;
- vim.fakeCursorBookmark = cm.setBookmark(from, {widget: widget});
- } else {
- vim.fakeCursor = cm.markText(from, to, {className: className});
- }
- }
- function clearFakeCursor(vim) {
- if (vim.fakeCursor) {
- vim.fakeCursor.clear();
- vim.fakeCursor = null;
- }
- if (vim.fakeCursorBookmark) {
- vim.fakeCursorBookmark.clear();
- vim.fakeCursorBookmark = null;
- }
}
function handleExternalSelection(cm, vim) {
var anchor = cm.getCursor('anchor');
@@ -5568,12 +5716,12 @@
if (change instanceof InsertModeKey) {
CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
} else if (typeof change == "string") {
- var cur = cm.getCursor();
- cm.replaceRange(change, cur, cur);
+ cm.replaceSelection(change);
} else {
var start = cm.getCursor();
var end = offsetCursor(start, 0, change[0].length);
cm.replaceRange(change[0], start, end);
+ cm.setCursor(end);
}
}
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.css b/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.css
index 56896500..f4d5718a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.css
@@ -60,20 +60,13 @@
.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
-.cm-fat-cursor-mark {
- background-color: rgba(20, 255, 20, 0.5);
- -webkit-animation: blink 1.06s steps(1) infinite;
- -moz-animation: blink 1.06s steps(1) infinite;
- animation: blink 1.06s steps(1) infinite;
-}
-.cm-animate-fat-cursor {
- width: auto;
- border: 0;
- -webkit-animation: blink 1.06s steps(1) infinite;
- -moz-animation: blink 1.06s steps(1) infinite;
- animation: blink 1.06s steps(1) infinite;
- background-color: #7e7;
-}
+.cm-fat-cursor .CodeMirror-line::selection,
+.cm-fat-cursor .CodeMirror-line > span::selection,
+.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }
+.cm-fat-cursor .CodeMirror-line::-moz-selection,
+.cm-fat-cursor .CodeMirror-line > span::-moz-selection,
+.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }
+.cm-fat-cursor { caret-color: transparent; }
@-moz-keyframes blink {
0% {}
50% { background-color: transparent; }
@@ -171,6 +164,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
+ z-index: 0;
}
.CodeMirror-sizer {
position: relative;
@@ -184,6 +178,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
position: absolute;
z-index: 6;
display: none;
+ outline: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
diff --git a/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.js b/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.js
index 7cee4096..193d445b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/lib/codemirror.js
@@ -32,7 +32,7 @@
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
var phantom = /PhantomJS/.test(userAgent);
- var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
+ var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);
var android = /Android/.test(userAgent);
// This is woefully incomplete. Suggestions for alternative methods welcome.
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
@@ -1311,6 +1311,7 @@
if (span.marker == marker) { return span }
} }
}
+
// Remove a span from an array, returning undefined if no spans are
// left (we don't store arrays for lines without spans).
function removeMarkedSpan(spans, span) {
@@ -1319,9 +1320,16 @@
{ if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
return r
}
+
// Add a span to a line.
- function addMarkedSpan(line, span) {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ function addMarkedSpan(line, span, op) {
+ var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));
+ if (inThisOp && inThisOp.has(line.markedSpans)) {
+ line.markedSpans.push(span);
+ } else {
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ if (inThisOp) { inThisOp.add(line.markedSpans); }
+ }
span.marker.attachLine(line);
}
@@ -1841,7 +1849,7 @@
}
}
builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;
- if (style || startStyle || endStyle || mustWrap || css) {
+ if (style || startStyle || endStyle || mustWrap || css || attributes) {
var fullStyle = style || "";
if (startStyle) { fullStyle += startStyle; }
if (endStyle) { fullStyle += endStyle; }
@@ -2186,6 +2194,7 @@
if (cm.options.lineNumbers || markers) {
var wrap$1 = ensureLineWrapped(lineView);
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
+ gutterWrap.setAttribute("aria-hidden", "true");
cm.display.input.setUneditable(gutterWrap);
wrap$1.insertBefore(gutterWrap, lineView.text);
if (lineView.line.gutterClass)
@@ -2342,12 +2351,14 @@
function mapFromLineView(lineView, line, lineN) {
if (lineView.line == line)
{ return {map: lineView.measure.map, cache: lineView.measure.cache} }
- for (var i = 0; i < lineView.rest.length; i++)
- { if (lineView.rest[i] == line)
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
- { if (lineNo(lineView.rest[i$1]) > lineN)
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ if (lineView.rest) {
+ for (var i = 0; i < lineView.rest.length; i++)
+ { if (lineView.rest[i] == line)
+ { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
+ for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
+ { if (lineNo(lineView.rest[i$1]) > lineN)
+ { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
+ }
}
// Render a line into the hidden node display.externalMeasured. Used
@@ -2574,9 +2585,11 @@
}
function widgetTopHeight(lineObj) {
+ var ref = visualLine(lineObj);
+ var widgets = ref.widgets;
var height = 0;
- if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)
- { height += widgetHeight(lineObj.widgets[i]); } } }
+ if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)
+ { height += widgetHeight(widgets[i]); } } }
return height
}
@@ -3141,13 +3154,19 @@
var curFragment = result.cursors = document.createDocumentFragment();
var selFragment = result.selection = document.createDocumentFragment();
+ var customCursor = cm.options.$customCursor;
+ if (customCursor) { primary = true; }
for (var i = 0; i < doc.sel.ranges.length; i++) {
if (!primary && i == doc.sel.primIndex) { continue }
var range = doc.sel.ranges[i];
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
var collapsed = range.empty();
- if (collapsed || cm.options.showCursorWhenSelecting)
- { drawSelectionCursor(cm, range.head, curFragment); }
+ if (customCursor) {
+ var head = customCursor(cm, range);
+ if (head) { drawSelectionCursor(cm, head, curFragment); }
+ } else if (collapsed || cm.options.showCursorWhenSelecting) {
+ drawSelectionCursor(cm, range.head, curFragment);
+ }
if (!collapsed)
{ drawSelectionRange(cm, range, selFragment); }
}
@@ -3163,6 +3182,12 @@
cursor.style.top = pos.top + "px";
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
+ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
+ var charPos = charCoords(cm, head, "div", null, null);
+ var width = charPos.right - charPos.left;
+ cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px";
+ }
+
if (pos.other) {
// Secondary cursor, shown when on a 'jump' in bi-directional text
var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
@@ -3276,26 +3301,31 @@
var on = true;
display.cursorDiv.style.visibility = "";
if (cm.options.cursorBlinkRate > 0)
- { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
- cm.options.cursorBlinkRate); }
+ { display.blinker = setInterval(function () {
+ if (!cm.hasFocus()) { onBlur(cm); }
+ display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden";
+ }, cm.options.cursorBlinkRate); }
else if (cm.options.cursorBlinkRate < 0)
{ display.cursorDiv.style.visibility = "hidden"; }
}
function ensureFocus(cm) {
- if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
+ if (!cm.hasFocus()) {
+ cm.display.input.focus();
+ if (!cm.state.focused) { onFocus(cm); }
+ }
}
function delayBlurEvent(cm) {
cm.state.delayingBlurEvent = true;
setTimeout(function () { if (cm.state.delayingBlurEvent) {
cm.state.delayingBlurEvent = false;
- onBlur(cm);
+ if (cm.state.focused) { onBlur(cm); }
} }, 100);
}
function onFocus(cm, e) {
- if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }
+ if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
if (cm.options.readOnly == "nocursor") { return }
if (!cm.state.focused) {
@@ -3330,10 +3360,14 @@
function updateHeightsInViewport(cm) {
var display = cm.display;
var prevBottom = display.lineDiv.offsetTop;
+ var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);
+ var oldHeight = display.lineDiv.getBoundingClientRect().top;
+ var mustScroll = 0;
for (var i = 0; i < display.view.length; i++) {
var cur = display.view[i], wrapping = cm.options.lineWrapping;
var height = (void 0), width = 0;
if (cur.hidden) { continue }
+ oldHeight += cur.line.height;
if (ie && ie_version < 8) {
var bot = cur.node.offsetTop + cur.node.offsetHeight;
height = bot - prevBottom;
@@ -3348,6 +3382,7 @@
}
var diff = cur.line.height - height;
if (diff > .005 || diff < -.005) {
+ if (oldHeight < viewTop) { mustScroll -= diff; }
updateLineHeight(cur.line, height);
updateWidgetHeight(cur.line);
if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
@@ -3362,6 +3397,7 @@
}
}
}
+ if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }
}
// Read and store the height of line widgets associated with the
@@ -3425,8 +3461,8 @@
// Set pos and end to the cursor positions around the character pos sticks to
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
// If pos == Pos(_, 0, "before"), pos and end are unchanged
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
}
for (var limit = 0; limit < 5; limit++) {
var changed = false;
@@ -3477,14 +3513,15 @@
if (newTop != screentop) { result.scrollTop = newTop; }
}
- var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
- var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
+ var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;
+ var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;
+ var screenw = displayWidth(cm) - display.gutters.offsetWidth;
var tooWide = rect.right - rect.left > screenw;
if (tooWide) { rect.right = rect.left + screenw; }
if (rect.left < 10)
{ result.scrollLeft = 0; }
else if (rect.left < screenleft)
- { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }
+ { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }
else if (rect.right > screenw + screenleft - 3)
{ result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
return result
@@ -3621,6 +3658,7 @@
this.vert.firstChild.style.height =
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
} else {
+ this.vert.scrollTop = 0;
this.vert.style.display = "";
this.vert.firstChild.style.height = "0";
}
@@ -3776,7 +3814,8 @@
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
scrollToPos: null, // Used to scroll to a specific position
focus: false,
- id: ++nextOpId // Unique ID
+ id: ++nextOpId, // Unique ID
+ markArrays: null // Used by addMarkedSpan
};
pushOperation(cm.curOp);
}
@@ -4229,6 +4268,8 @@
function updateGutterSpace(display) {
var width = display.gutters.offsetWidth;
display.sizer.style.marginLeft = width + "px";
+ // Send an event to consumers responding to changes in gutter width.
+ signalLater(display, "gutterChanged", display);
}
function setDocumentHeight(cm, measure) {
@@ -4368,6 +4409,10 @@
// The element in which the editor lives.
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
+ // This attribute is respected by automatic translation systems such as Google Translate,
+ // and may also be respected by tools used by human translators.
+ d.wrapper.setAttribute('translate', 'no');
+
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
@@ -4465,6 +4510,12 @@
function onScrollWheel(cm, e) {
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
+ var pixelsPerUnit = wheelPixelsPerUnit;
+ if (e.deltaMode === 0) {
+ dx = e.deltaX;
+ dy = e.deltaY;
+ pixelsPerUnit = 1;
+ }
var display = cm.display, scroll = display.scroller;
// Quit if there's nothing to scroll here
@@ -4493,10 +4544,10 @@
// estimated pixels/delta value, we just handle horizontal
// scrolling entirely here. It'll be slightly off from native, but
// better than glitching out.
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
+ if (dx && !gecko && !presto && pixelsPerUnit != null) {
if (dy && canScrollY)
- { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));
// Only prevent default scrolling if vertical scrolling is
// actually possible. Otherwise, it causes vertical scroll
// jitter on OSX trackpads when deltaX is small and deltaY
@@ -4509,15 +4560,15 @@
// 'Project' the visible viewport to cover the area that is being
// scrolled into view (if we know enough to estimate it).
- if (dy && wheelPixelsPerUnit != null) {
- var pixels = dy * wheelPixelsPerUnit;
+ if (dy && pixelsPerUnit != null) {
+ var pixels = dy * pixelsPerUnit;
var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
updateDisplaySimple(cm, {top: top, bottom: bot});
}
- if (wheelSamples < 20) {
+ if (wheelSamples < 20 && e.deltaMode !== 0) {
if (display.wheelStartX == null) {
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
display.wheelDX = dx; display.wheelDY = dy;
@@ -4776,6 +4827,7 @@
estimateLineHeights(cm);
loadMode(cm);
setDirectionClass(cm);
+ cm.options.direction = doc.direction;
if (!cm.options.lineWrapping) { findMaxLine(cm); }
cm.options.mode = doc.modeOption;
regChange(cm);
@@ -4792,19 +4844,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
@@ -5109,7 +5161,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); }
}
@@ -5766,7 +5818,7 @@
changeLine(doc, handle, "widget", function (line) {
var widgets = line.widgets || (line.widgets = []);
if (widget.insertAt == null) { widgets.push(widget); }
- else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }
+ else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }
widget.line = line;
if (cm && !lineIsHidden(doc, line)) {
var aboveVisible = heightAtLine(line) < doc.scrollTop;
@@ -5952,7 +6004,7 @@
if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
addMarkedSpan(line, new MarkedSpan(marker,
curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null));
+ curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);
++curLine;
});
// lineIsHidden depends on the presence of the spans, so needs a second pass
@@ -6124,6 +6176,7 @@
getRange: function(from, to, lineSep) {
var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
if (lineSep === false) { return lines }
+ if (lineSep === '') { return lines.join('') }
return lines.join(lineSep || this.lineSeparator())
},
@@ -6175,7 +6228,7 @@
var out = [];
for (var i = 0; i < ranges.length; i++)
{ out[i] = new Range(clipPos(this, ranges[i].anchor),
- clipPos(this, ranges[i].head)); }
+ clipPos(this, ranges[i].head || ranges[i].anchor)); }
if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
setSelection(this, normalizeSelection(this.cm, out, primary), options);
}),
@@ -6238,7 +6291,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);
},
@@ -6259,7 +6312,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);
},
@@ -6678,10 +6731,9 @@
// Very basic readline/emacs-style bindings, which are standard on Mac.
keyMap.emacsy = {
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
- "Ctrl-O": "openLine"
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
+ "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
+ "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
};
keyMap.macDefault = {
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
@@ -7002,7 +7054,7 @@
goGroupRight: function (cm) { return cm.moveH(1, "group"); },
goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
goWordRight: function (cm) { return cm.moveH(1, "word"); },
- delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
+ delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); },
delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
@@ -7375,6 +7427,10 @@
var dragEnd = operation(cm, function (e) {
if (webkit) { display.scroller.draggable = false; }
cm.state.draggingText = false;
+ if (cm.state.delayingBlurEvent) {
+ if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }
+ else { delayBlurEvent(cm); }
+ }
off(display.wrapper.ownerDocument, "mouseup", dragEnd);
off(display.wrapper.ownerDocument, "mousemove", mouseMove);
off(display.scroller, "dragstart", dragStart);
@@ -7398,15 +7454,15 @@
if (webkit) { display.scroller.draggable = true; }
cm.state.draggingText = dragEnd;
dragEnd.copy = !behavior.moveOnDrag;
- // IE's approach to draggable
- if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
on(display.wrapper.ownerDocument, "mouseup", dragEnd);
on(display.wrapper.ownerDocument, "mousemove", mouseMove);
on(display.scroller, "dragstart", dragStart);
on(display.scroller, "drop", dragEnd);
- delayBlurEvent(cm);
+ cm.state.delayingBlurEvent = true;
setTimeout(function () { return display.input.focus(); }, 20);
+ // IE's approach to draggable
+ if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
}
function rangeForUnit(cm, pos, unit) {
@@ -7419,6 +7475,7 @@
// Normal selection, as opposed to text dragging.
function leftButtonSelect(cm, event, start, behavior) {
+ if (ie) { delayBlurEvent(cm); }
var display = cm.display, doc = cm.doc;
e_preventDefault(event);
@@ -7697,7 +7754,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(); }
});
@@ -7877,7 +7934,9 @@
attachDoc(this, doc);
if ((options.autofocus && !mobile) || this.hasFocus())
- { setTimeout(bind(onFocus, this), 20); }
+ { setTimeout(function () {
+ if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }
+ }, 20); }
else
{ onBlur(this); }
@@ -8186,7 +8245,7 @@
}
function hiddenTextarea() {
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
+ var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
// The textarea is kept positioned near the cursor to prevent the
// fact that it'll be scrolled into view on input from scrolling
@@ -8640,14 +8699,14 @@
}
// Used for horizontal relative motion. Dir is -1 or 1 (left or
- // right), unit can be "char", "column" (like char, but doesn't
- // cross line boundaries), "word" (across next word), or "group" (to
- // the start of next group of word or non-word-non-whitespace
- // chars). The visually param controls whether, in right-to-left
- // text, direction 1 means to move towards the next index in the
- // string, or towards the character to the right of the current
- // position. The resulting position will have a hitSide=true
- // property if it reached the end of the document.
+ // right), unit can be "codepoint", "char", "column" (like char, but
+ // doesn't cross line boundaries), "word" (across next word), or
+ // "group" (to the start of next group of word or
+ // non-word-non-whitespace chars). The visually param controls
+ // whether, in right-to-left text, direction 1 means to move towards
+ // the next index in the string, or towards the character to the right
+ // of the current position. The resulting position will have a
+ // hitSide=true property if it reached the end of the document.
function findPosH(doc, pos, dir, unit, visually) {
var oldPos = pos;
var origDir = dir;
@@ -8661,7 +8720,15 @@
}
function moveOnce(boundToLine) {
var next;
- if (visually) {
+ if (unit == "codepoint") {
+ var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));
+ if (isNaN(ch)) {
+ next = null;
+ } else {
+ var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;
+ next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);
+ }
+ } else if (visually) {
next = moveVisually(doc.cm, lineObj, pos, dir);
} else {
next = moveLogically(lineObj, pos, dir);
@@ -8677,7 +8744,7 @@
return true
}
- if (unit == "char") {
+ if (unit == "char" || unit == "codepoint") {
moveOnce();
} else if (unit == "column") {
moveOnce(true);
@@ -8745,6 +8812,7 @@
var input = this, cm = input.cm;
var div = input.div = display.lineDiv;
+ div.contentEditable = true;
disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
function belongsToInput(e) {
@@ -8811,7 +8879,7 @@
var kludge = hiddenTextarea(), te = kludge.firstChild;
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n");
- var hadFocus = document.activeElement;
+ var hadFocus = activeElt();
selectInput(te);
setTimeout(function () {
cm.display.lineSpace.removeChild(kludge);
@@ -8834,7 +8902,7 @@
ContentEditableInput.prototype.prepareSelection = function () {
var result = prepareSelection(this.cm, false);
- result.focus = document.activeElement == this.div;
+ result.focus = activeElt() == this.div;
return result
};
@@ -8930,7 +8998,7 @@
ContentEditableInput.prototype.focus = function () {
if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor() || document.activeElement != this.div)
+ if (!this.selectionInEditor() || activeElt() != this.div)
{ this.showSelection(this.prepareSelection(), true); }
this.div.focus();
}
@@ -8941,9 +9009,11 @@
ContentEditableInput.prototype.supportsTouch = function () { return true };
ContentEditableInput.prototype.receivedFocus = function () {
+ var this$1 = this;
+
var input = this;
if (this.selectionInEditor())
- { this.pollSelection(); }
+ { setTimeout(function () { return this$1.pollSelection(); }, 20); }
else
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
@@ -9621,6 +9691,7 @@
TextareaInput.prototype.readOnlyChanged = function (val) {
if (!val) { this.reset(); }
this.textarea.disabled = val == "nocursor";
+ this.textarea.readOnly = !!val;
};
TextareaInput.prototype.setUneditable = function () {};
@@ -9771,7 +9842,7 @@
addLegacyProps(CodeMirror);
- CodeMirror.version = "5.57.0";
+ CodeMirror.version = "5.65.2";
return CodeMirror;
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/asn.1/asn.1.js b/Mod manager/utils/QNModManager/CodeMirror/mode/asn.1/asn.1.js
index d3ecb087..df1330b6 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/asn.1/asn.1.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/clike/clike.js b/Mod manager/utils/QNModManager/CodeMirror/mode/clike/clike.js
index 37da2ec9..863992d8 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/clike/clike.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/clike/clike.js
@@ -82,15 +82,15 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
}
- if (isPunctuationChar.test(ch)) {
- curPunc = ch;
- return null;
- }
if (numberStart.test(ch)) {
stream.backUp(1)
if (stream.match(number)) return "number"
stream.next()
}
+ if (isPunctuationChar.test(ch)) {
+ curPunc = ch;
+ return null;
+ }
if (ch == "/") {
if (stream.eat("*")) {
state.tokenize = tokenComment;
@@ -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;
@@ -484,7 +484,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"instanceof interface native new package private protected public " +
"return static strictfp super switch synchronized this throw throws transient " +
"try volatile while @interface"),
- types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
+ types: words("var byte short int long float double boolean char void Boolean Byte Character Double Float " +
"Integer Long Number Object Short String StringBuffer StringBuilder Void"),
blockKeywords: words("catch class do else finally for if switch try while"),
defKeywords: words("class interface enum @interface"),
@@ -498,6 +498,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
stream.eatWhile(/[\w\$_]/);
return "meta";
+ },
+ '"': function(stream, state) {
+ if (!stream.match('""\n')) return false;
+ state.tokenize = tokenTripleString;
+ return state.tokenize(stream, state);
}
},
modeProps: {fold: ["brace", "import"]}
@@ -659,7 +664,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"file import where by get set abstract enum open inner override private public internal " +
"protected catch finally out final vararg reified dynamic companion constructor init " +
"sealed field property receiver param sparam lateinit data inline noinline tailrec " +
- "external annotation crossinline const operator infix suspend actual expect setparam"
+ "external annotation crossinline const operator infix suspend actual expect setparam value"
),
types: words(
/* package java.lang */
@@ -749,7 +754,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/Mod manager/utils/QNModManager/CodeMirror/mode/clike/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/clike/index.html
index 0cfae214..b1c88190 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/clike/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/clike/index.html
@@ -148,7 +148,7 @@ Objective-C example
*/
#import "MyClass.h"
-#import
+#import
@import BFrameworkModule;
NS_ENUM(SomeValues) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/clojure/clojure.js b/Mod manager/utils/QNModManager/CodeMirror/mode/clojure/clojure.js
index 25d308ab..0b9d6acc 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/clojure/clojure.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/clojure/clojure.js
@@ -160,10 +160,10 @@ CodeMirror.defineMode("clojure", function (options) {
var numberLiteral = /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/;
var characterLiteral = /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/;
- // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/
+ // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*/
// simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/
// qualified-symbol := ((<.>)*>)?
- var qualifiedSymbol = /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;
+ var qualifiedSymbol = /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;
function base(stream, state) {
if (stream.eatSpace() || stream.eat(",")) return ["space", null];
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/cobol/cobol.js b/Mod manager/utils/QNModManager/CodeMirror/mode/cobol/cobol.js
index 275857b4..a7aeafa0 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/cobol/cobol.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/cobol/cobol.js
@@ -195,7 +195,7 @@ CodeMirror.defineMode("cobol", function () {
case "string": // multi-line string parsing mode
var next = false;
while ((next = stream.next()) != null) {
- if (next == "\"" || next == "\'") {
+ if ((next == "\"" || next == "\'") && !stream.match(/['"]/, false)) {
state.mode = false;
break;
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/commonlisp/commonlisp.js b/Mod manager/utils/QNModManager/CodeMirror/mode/commonlisp/commonlisp.js
index 52abbb25..e8528a9c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/commonlisp/commonlisp.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/commonlisp/commonlisp.js
@@ -114,6 +114,7 @@ CodeMirror.defineMode("commonlisp", function (config) {
closeBrackets: {pairs: "()[]{}\"\""},
lineComment: ";;",
+ fold: "brace-paren",
blockCommentStart: "#|",
blockCommentEnd: "|#"
};
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/crystal/crystal.js b/Mod manager/utils/QNModManager/CodeMirror/mode/crystal/crystal.js
index 5c601c6a..5dae5032 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/crystal/crystal.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/crystal/crystal.js
@@ -164,10 +164,10 @@
} else {
if(delim = stream.match(/^%([^\w\s=])/)) {
delim = delim[1];
- } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) {
+ } else if (stream.match(/^%[a-zA-Z_\u009F-\uFFFF][\w\u009F-\uFFFF]*/)) {
// Macro variables
return "meta";
- } else {
+ } else if (stream.eat('%')) {
// '%' operator
return "operator";
}
@@ -194,17 +194,17 @@
// Numbers
if (stream.eat("0")) {
if (stream.eat("x")) {
- stream.match(/^[0-9a-fA-F]+/);
+ stream.match(/^[0-9a-fA-F_]+/);
} else if (stream.eat("o")) {
- stream.match(/^[0-7]+/);
+ stream.match(/^[0-7_]+/);
} else if (stream.eat("b")) {
- stream.match(/^[01]+/);
+ stream.match(/^[01_]+/);
}
return "number";
}
if (stream.eat(/^\d/)) {
- stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);
+ stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?/);
return "number";
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/css/css.js b/Mod manager/utils/QNModManager/CodeMirror/mode/css/css.js
index 77ca0c10..503c48c2 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/css/css.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/css/css.js
@@ -29,7 +29,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
valueKeywords = parserConfig.valueKeywords || {},
allowNested = parserConfig.allowNested,
lineComment = parserConfig.lineComment,
- supportsAtComponent = parserConfig.supportsAtComponent === true;
+ supportsAtComponent = parserConfig.supportsAtComponent === true,
+ highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;
var type, override;
function ret(style, tp) { type = tp; return style; }
@@ -77,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");
@@ -107,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;
@@ -197,7 +198,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
override = "property";
return "maybeprop";
} else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
- override = "string-2";
+ override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
return "maybeprop";
} else if (allowNested) {
override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
@@ -291,7 +292,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
else if (propertyKeywords.hasOwnProperty(word))
override = "property";
else if (nonStandardPropertyKeywords.hasOwnProperty(word))
- override = "string-2";
+ override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
else if (valueKeywords.hasOwnProperty(word))
override = "atom";
else if (colorKeywords.hasOwnProperty(word))
@@ -442,13 +443,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"monochrome", "min-monochrome", "max-monochrome", "resolution",
"min-resolution", "max-resolution", "scan", "grid", "orientation",
"device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
- "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme"
+ "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme",
+ "dynamic-range", "video-dynamic-range"
], mediaFeatures = keySet(mediaFeatures_);
var mediaValueKeywords_ = [
"landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
"interlace", "progressive",
- "dark", "light"
+ "dark", "light",
+ "standard", "high"
], mediaValueKeywords = keySet(mediaValueKeywords_);
var propertyKeywords_ = [
@@ -481,7 +484,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"cue-before", "cursor", "direction", "display", "dominant-baseline",
"drop-initial-after-adjust", "drop-initial-after-align",
"drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
- "drop-initial-value", "elevation", "empty-cells", "fit", "fit-position",
+ "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position",
"flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
"flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
"font", "font-family", "font-feature-settings", "font-kerning",
@@ -563,7 +566,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
], propertyKeywords = keySet(propertyKeywords_);
var nonStandardPropertyKeywords_ = [
- "border-block", "border-block-color", "border-block-end",
+ "accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end",
"border-block-end-color", "border-block-end-style", "border-block-end-width",
"border-block-start", "border-block-start-color", "border-block-start-style",
"border-block-start-width", "border-block-style", "border-block-width",
@@ -571,9 +574,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"border-inline-end-color", "border-inline-end-style",
"border-inline-end-width", "border-inline-start", "border-inline-start-color",
"border-inline-start-style", "border-inline-start-width",
- "border-inline-style", "border-inline-width", "margin-block",
+ "border-inline-style", "border-inline-width", "content-visibility", "margin-block",
"margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
- "margin-inline-start", "padding-block", "padding-block-end",
+ "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end",
"padding-block-start", "padding-inline", "padding-inline-end",
"padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
"scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
@@ -597,16 +600,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
- "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
+ "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
- "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
- "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
+ "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet",
+ "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
- "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey",
"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
@@ -616,7 +619,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
"purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
"salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
- "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
+ "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan",
"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
"whitesmoke", "yellow", "yellowgreen"
], colorKeywords = keySet(colorKeywords_);
@@ -627,21 +630,21 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
"arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
"avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary",
- "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
- "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
+ "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box",
+ "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "button-bevel",
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
- "compact", "condensed", "contain", "content", "contents",
- "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
+ "compact", "condensed", "conic-gradient", "contain", "content", "contents",
+ "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
+ "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
"dot-dash", "dot-dot-dash",
- "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
+ "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
@@ -651,10 +654,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
"extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
- "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
+ "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove",
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
@@ -684,15 +687,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
"progress", "push-button", "radial-gradient", "radio", "read-only",
"read-write", "read-write-plaintext-only", "rectangle", "region",
- "relative", "repeat", "repeating-linear-gradient",
- "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
+ "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient",
+ "repeating-conic-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
- "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
+ "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
- "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
+ "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama",
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
@@ -780,7 +783,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/Mod manager/utils/QNModManager/CodeMirror/mode/css/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/css/index.html
index 6588c408..42b327ca 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/css/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/css/index.html
@@ -68,6 +68,12 @@ CSS mode
});
+ CSS mode supports this option:
+
+ highlightNonStandardPropertyKeywords : boolean
+ Whether to highlight non-standard CSS property keywords such as margin-inline
or zoom
(default: true
).
+
+
MIME types defined: text/css
, text/x-scss
(demo ), text/x-less
(demo ).
Parsing/Highlighting Tests: normal , verbose .
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/cypher/cypher.js b/Mod manager/utils/QNModManager/CodeMirror/mode/cypher/cypher.js
index aa76eb9e..6203d599 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/cypher/cypher.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/cypher/cypher.js
@@ -19,13 +19,14 @@
CodeMirror.defineMode("cypher", function(config) {
var tokenBase = function(stream/*, state*/) {
+ curPunc = null
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/Mod manager/utils/QNModManager/CodeMirror/mode/dtd/dtd.js b/Mod manager/utils/QNModManager/CodeMirror/mode/dtd/dtd.js
index 74b8c6bd..1bff91cb 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/dtd/dtd.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/ebnf/ebnf.js b/Mod manager/utils/QNModManager/CodeMirror/mode/ebnf/ebnf.js
index 238bbe23..d8fb3f3a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/ebnf/ebnf.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/erlang/erlang.js b/Mod manager/utils/QNModManager/CodeMirror/mode/erlang/erlang.js
index f0541bb9..d827296f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/erlang/erlang.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/erlang/erlang.js
@@ -339,8 +339,8 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
}
function lookahead(stream) {
- var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false);
- return m ? m.pop() : "";
+ var m = stream.match(/^\s*([^\s%])/, false)
+ return m ? m[1] : "";
}
function is_member(element,list) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/factor/factor.js b/Mod manager/utils/QNModManager/CodeMirror/mode/factor/factor.js
index 7108278c..d3f7d499 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/factor/factor.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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"},
@@ -77,7 +77,7 @@
// specific to simple modes.
meta: {
dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
- lineComment: [ "!", "#!" ]
+ lineComment: "!"
}
});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/factor/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/factor/index.html
index 574d402d..6a77230d 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/factor/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/factor/index.html
@@ -70,7 +70,7 @@ Factor mode
});
-Simple mode that handles Factor Syntax (Factor on WikiPedia ).
+Simple mode that handles Factor Syntax (Factor on Wikipedia ).
MIME types defined: text/x-factor
.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/fcl/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/fcl/index.html
index e51fa166..9194dfdd 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/fcl/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/fcl/index.html
@@ -61,7 +61,7 @@ FCL mode
END_FUZZIFY
DEFUZZIFY ProbabilityAccess
- TERM hight := 1;
+ TERM height := 1;
TERM medium := 0.5;
TERM low := 0;
ACCU: MAX;
@@ -70,7 +70,7 @@ FCL mode
END_DEFUZZIFY
DEFUZZIFY ProbabilityDistribution
- TERM hight := 1;
+ TERM height := 1;
TERM medium := 0.5;
TERM low := 0;
ACCU: MAX;
@@ -80,14 +80,14 @@ FCL mode
RULEBLOCK No1
AND : MIN;
- RULE 1 : IF TimeDay IS outside AND ApplicateHost IS few THEN ProbabilityAccess IS hight;
- RULE 2 : IF ApplicateHost IS many THEN ProbabilityAccess IS hight;
+ RULE 1 : IF TimeDay IS outside AND ApplicateHost IS few THEN ProbabilityAccess IS height;
+ RULE 2 : IF ApplicateHost IS many THEN ProbabilityAccess IS height;
RULE 3 : IF TimeDay IS inside AND ApplicateHost IS few THEN ProbabilityAccess IS low;
END_RULEBLOCK
RULEBLOCK No2
AND : MIN;
- RULE 1 : IF ApplicateHost IS many THEN ProbabilityDistribution IS hight;
+ RULE 1 : IF ApplicateHost IS many THEN ProbabilityDistribution IS height;
END_RULEBLOCK
END_FUNCTION_BLOCK
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/forth/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/forth/index.html
index c6f0b5c5..6b6477ca 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/forth/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/forth/index.html
@@ -68,7 +68,7 @@ Forth mode
});
-Simple mode that handle Forth-Syntax (Forth on WikiPedia ).
+Simple mode that handle Forth-Syntax (Forth on Wikipedia ).
MIME types defined: text/x-forth
.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/fortran/fortran.js b/Mod manager/utils/QNModManager/CodeMirror/mode/fortran/fortran.js
index 85bacc42..c33cf63e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/fortran/fortran.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/fortran/fortran.js
@@ -112,7 +112,7 @@ CodeMirror.defineMode("fortran", function() {
"c_short", "c_signed_char", "c_size_t", "character",
"complex", "double", "integer", "logical", "real"]);
var isOperatorChar = /[+\-*&=<>\/\:]/;
- var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i");
+ var litOperator = /^\.(and|or|eq|lt|le|gt|ge|ne|not|eqv|neqv)\./i;
function tokenBase(stream, state) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/gas/gas.js b/Mod manager/utils/QNModManager/CodeMirror/mode/gas/gas.js
index e34d7a7b..016dc29d 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/gas/gas.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/gas/gas.js
@@ -144,18 +144,26 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) {
function x86(_parserConfig) {
lineCommentStartSymbol = "#";
+ registers.al = "variable";
+ registers.ah = "variable";
registers.ax = "variable";
registers.eax = "variable-2";
registers.rax = "variable-3";
+ registers.bl = "variable";
+ registers.bh = "variable";
registers.bx = "variable";
registers.ebx = "variable-2";
registers.rbx = "variable-3";
+ registers.cl = "variable";
+ registers.ch = "variable";
registers.cx = "variable";
registers.ecx = "variable-2";
registers.rcx = "variable-3";
+ registers.dl = "variable";
+ registers.dh = "variable";
registers.dx = "variable";
registers.edx = "variable-2";
registers.rdx = "variable-3";
@@ -302,11 +310,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/Mod manager/utils/QNModManager/CodeMirror/mode/gfm/test.js b/Mod manager/utils/QNModManager/CodeMirror/mode/gfm/test.js
index d933896a..e2002879 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/gfm/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/gfm/test.js
@@ -92,7 +92,7 @@
"[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
MT("wordSHA",
- "ask for feedbac")
+ "ask for feedback")
MT("num",
"foo [link #1] bar");
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/haml/haml.js b/Mod manager/utils/QNModManager/CodeMirror/mode/haml/haml.js
index 3c8f505e..d941d974 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/haml/haml.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/htmlembedded/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/htmlembedded/index.html
index b1cafde9..d17afec8 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/htmlembedded/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/htmlembedded/index.html
@@ -55,6 +55,6 @@ Html Embedded Scripts mode
JavaScript, CSS and XML. Other dependencies include those of the scripting language chosen.
MIME types defined: application/x-aspx
(ASP.NET),
- application/x-ejs
(Embedded Javascript), application/x-jsp
(JavaServer Pages)
+ application/x-ejs
(Embedded JavaScript), application/x-jsp
(JavaServer Pages)
and application/x-erb
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/htmlmixed/htmlmixed.js b/Mod manager/utils/QNModManager/CodeMirror/mode/htmlmixed/htmlmixed.js
index 8341ac82..af313817 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/htmlmixed/htmlmixed.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/htmlmixed/htmlmixed.js
@@ -50,7 +50,7 @@
}
function getTagRegexp(tagName, anchored) {
- return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
+ return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i");
}
function addTags(from, to) {
@@ -74,7 +74,8 @@
name: "xml",
htmlMode: true,
multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
- multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag,
+ allowMissingTagName: parserConfig.allowMissingTagName,
});
var tags = {};
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/idl/idl.js b/Mod manager/utils/QNModManager/CodeMirror/mode/idl/idl.js
index 168761cd..37302bb9 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/idl/idl.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/index.html
index 858ba127..51205ddc 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/index.html
@@ -153,6 +153,7 @@ Language modes
VHDL
Vue.js app
Web IDL
+ WebAssembly Text Format
XML/HTML
XQuery
Yacas
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/index.html
index d1f7f68e..2b6cede8 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/index.html
@@ -99,6 +99,10 @@ JavaScript mode
typescript
which will activate additional
syntax highlighting and some other things for TypeScript code
(demo ).
+ trackScope
can be set to false to turn off
+ tracking of local variables. This will prevent locals from
+ getting the "variable-2"
token type, and will
+ break completion of locals with javascript-hint.
statementIndent
which (given a number) will
determine the amount of indentation to use for statements
continued on a new line.
@@ -110,5 +114,5 @@ JavaScript mode
- MIME types defined: text/javascript
, application/json
, application/ld+json
, text/typescript
, application/typescript
.
+ MIME types defined: text/javascript
, application/javascript
, application/x-javascript
, text/ecmascript
, application/ecmascript
, application/json
, application/x-json
, application/manifest+json
, application/ld+json
, text/typescript
, application/typescript
.
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/javascript.js b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/javascript.js
index 9c751d23..7cfee313 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/javascript.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/javascript.js
@@ -16,6 +16,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
+ var trackScope = parserConfig.trackScope !== false
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
@@ -111,7 +112,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (ch != ">" || !state.lexical || state.lexical.type != ">") {
if (stream.eat("=")) {
if (ch == "!" || ch == "=") stream.eat("=")
- } else if (/[<>*+\-]/.test(ch)) {
+ } else if (/[<>*+\-|&?]/.test(ch)) {
stream.eat(ch)
if (ch == ">") stream.eat(ch)
}
@@ -126,7 +127,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var kw = keywords[word]
return ret(kw.type, kw.style, word)
}
- if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
+ if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word)
}
return ret("variable", "variable", word)
@@ -218,7 +219,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
// Parser
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
+ "regexp": true, "this": true, "import": true, "jsonld-keyword": true};
function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
@@ -230,6 +232,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function inScope(state, varname) {
+ if (!trackScope) return false
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
@@ -276,6 +279,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function register(varname) {
var state = cx.state;
cx.marked = "def";
+ if (!trackScope) return
if (state.context) {
if (state.lexical.info == "var" && state.context && state.context.block) {
// FIXME function decls are also not block scoped
@@ -326,6 +330,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
cx.state.localVars = null
}
+ pushcontext.lex = pushblockcontext.lex = true
function popcontext() {
cx.state.localVars = cx.state.context.vars
cx.state.context = cx.state.context.prev
@@ -375,7 +380,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
- if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
+ if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
@@ -441,7 +446,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") return pass(quasi, maybeop);
if (type == "new") return cont(maybeTarget(noComma));
- if (type == "import") return cont(expression);
return cont();
}
function maybeexpression(type) {
@@ -479,7 +483,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
- return cont(expression, continueQuasi);
+ return cont(maybeexpression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
@@ -605,7 +609,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
}
function typeexpr(type, value) {
- if (value == "keyof" || value == "typeof" || value == "infer") {
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
cx.marked = "keyword"
return cont(value == "typeof" ? expressionNoComma : typeexpr)
}
@@ -616,13 +620,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "|" || value == "&") return cont(typeexpr)
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
- if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
+ if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
+ if (type == "quasi") { return pass(quasiType, afterType); }
}
function maybeReturnType(type) {
if (type == "=>") return cont(typeexpr)
}
+ function typeprops(type) {
+ if (type.match(/[\}\)\]]/)) return cont()
+ if (type == "," || type == ";") return cont(typeprops)
+ return pass(typeprop, typeprops)
+ }
function typeprop(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property"
@@ -635,6 +645,20 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop)
} else if (type == "(") {
return pass(functiondecl, typeprop)
+ } else if (!type.match(/[;\}\)\],]/)) {
+ return cont()
+ }
+ }
+ function quasiType(type, value) {
+ if (type != "quasi") return pass();
+ if (value.slice(value.length - 2) != "${") return cont(quasiType);
+ return cont(typeexpr, continueQuasiType);
+ }
+ function continueQuasiType(type) {
+ if (type == "}") {
+ cx.marked = "string-2";
+ cx.state.tokenize = tokenQuasi;
+ return cont(quasiType);
}
}
function typearg(type, value) {
@@ -776,6 +800,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
+ if (value == "!") return cont(classfield)
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)
@@ -795,6 +820,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function afterImport(type) {
if (type == "string") return cont();
if (type == "(") return pass(expression);
+ if (type == ".") return pass(maybeoperatorComma);
return pass(importSpec, maybeMoreImports, maybeFrom);
}
function importSpec(type, value) {
@@ -868,14 +894,14 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
},
indent: function(state, textAfter) {
- if (state.tokenize == tokenComment) return CodeMirror.Pass;
+ if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;
if (state.tokenize != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
// Kludge to prevent 'maybelse' from blocking lexical scope pops
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
var c = state.cc[i];
if (c == poplex) lexical = lexical.prev;
- else if (c != maybeelse) break;
+ else if (c != maybeelse && c != popcontext) break;
}
while ((lexical.type == "stat" || lexical.type == "form") &&
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
@@ -912,8 +938,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
expressionAllowed: expressionAllowed,
skipExpression: function(state) {
- var top = state.cc[state.cc.length - 1]
- if (top == expression || top == expressionNoComma) state.cc.pop()
+ parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null))
}
};
});
@@ -925,9 +950,10 @@ CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
-CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
-CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
-CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
+CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
+CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
+CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true })
+CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/test.js b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/test.js
index ffff05f5..e7303020 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/javascript/test.js
@@ -164,9 +164,9 @@
MT("indent_for",
"[keyword for] ([keyword var] [def i] [operator =] [number 0];",
- " [variable i] [operator <] [number 100];",
- " [variable i][operator ++])",
- " [variable doSomething]([variable i]);",
+ " [variable-2 i] [operator <] [number 100];",
+ " [variable-2 i][operator ++])",
+ " [variable doSomething]([variable-2 i]);",
"[keyword debugger];");
MT("indent_c_style",
@@ -252,7 +252,7 @@
MT("async_object",
"[keyword let] [def obj] [operator =] { [property async]: [atom false] };");
- // async be highlighet as keyword and foo as def, but it requires potentially expensive look-ahead. See #4173
+ // async be highlighted as keyword and foo as def, but it requires potentially expensive look-ahead. See #4173
MT("async_object_function",
"[keyword let] [def obj] [operator =] { [property async] [property foo]([def args]) { [keyword return] [atom true]; } };");
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/jsx.js b/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/jsx.js
index 889d3fe5..beea3b91 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/jsx.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/jsx.js
@@ -104,9 +104,9 @@
function jsToken(stream, state, cx) {
if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
- jsMode.skipExpression(cx.state)
state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "", "")),
xmlMode, 0, state.context)
+ jsMode.skipExpression(cx.state)
return null
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/test.js b/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/test.js
index 5ecd5a8b..b47a3521 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/jsx/test.js
@@ -73,6 +73,13 @@
MT("tag_attribute",
"([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])")
+ MT("in_array",
+ "[[",
+ " [bracket&tag <][tag Something][bracket&tag />],",
+ " [string-2 `${][variable x][string-2 }`],",
+ " [variable y]",
+ "]]")
+
var ts_mode = CodeMirror.getMode({indentUnit: 2}, "text/typescript-jsx")
function TS(name) { test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1)) }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/julia/julia.js b/Mod manager/utils/QNModManager/CodeMirror/mode/julia/julia.js
index f1d2cd5c..cb0d69c8 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/julia/julia.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/julia/julia.js
@@ -12,9 +12,10 @@
"use strict";
CodeMirror.defineMode("julia", function(config, parserConf) {
- function wordRegexp(words, end) {
+ function wordRegexp(words, end, pre) {
+ if (typeof pre === "undefined") { pre = ""; }
if (typeof end === "undefined") { end = "\\b"; }
- return new RegExp("^((" + words.join(")|(") + "))" + end);
+ return new RegExp("^" + pre + "((" + words.join(")|(") + "))" + end);
}
var octChar = "\\\\[0-7]{1,3}";
@@ -22,13 +23,18 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
var sChar = "\\\\[abefnrtv0%?'\"\\\\]";
var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
+ var asciiOperatorsList = [
+ "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "--?>", "<--[->]?", "\\/\\/",
+ "\\.{2,3}", "[\\.\\\\%*+\\-<>!\\/^|&]=?", "\\?", "\\$", "~", ":"
+ ];
var operators = parserConf.operators || wordRegexp([
- "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/",
- "[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
- "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
- "\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
- "\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
- "\\b(in|isa)\\b(?!\.?\\()"], "");
+ "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "--?>", "<--[->]?", "\\/\\/",
+ "[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
+ "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
+ "\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
+ "\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
+ "\\b(in|isa)\\b(?!\.?\\()"
+ ], "");
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
var identifiers = parserConf.identifiers ||
/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;
@@ -57,10 +63,13 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
var keywords = wordRegexp(keywordsList);
var builtins = wordRegexp(builtinsList);
- var macro = /^@[_A-Za-z][\w]*/;
+ var macro = /^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;
+ var macroOperators = wordRegexp(asciiOperatorsList, "", "@");
+ var symbolOperators = wordRegexp(asciiOperatorsList, "", ":");
+
function inArray(state) {
return (state.nestedArrays > 0);
}
@@ -80,7 +89,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 +150,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";
}
}
@@ -165,8 +174,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
}
// Handle symbols
- if (!leavingExpr && stream.match(symbol) ||
- stream.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)) {
+ if (!leavingExpr && (stream.match(symbol) || stream.match(symbolOperators))) {
return "builtin";
}
@@ -201,7 +209,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
}
// Handle Chars
- if (stream.match(/^'/)) {
+ if (stream.match('\'')) {
state.tokenize = tokenChar;
return state.tokenize(stream, state);
}
@@ -212,7 +220,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
return state.tokenize(stream, state);
}
- if (stream.match(macro)) {
+ if (stream.match(macro) || stream.match(macroOperators)) {
return "meta";
}
@@ -241,10 +249,6 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
state.isDefinition = false;
return "def";
}
- if (stream.match(/^({[^}]*})*\(/, false)) {
- state.tokenize = tokenCallOrDef;
- return state.tokenize(stream, state);
- }
state.leavingExpr = true;
return "variable";
}
@@ -254,49 +258,11 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
return "error";
}
- function tokenCallOrDef(stream, state) {
- var match = stream.match(/^(\(\s*)/);
- if (match) {
- if (state.firstParenPos < 0)
- state.firstParenPos = state.scopes.length;
- state.scopes.push('(');
- state.charsAdvanced += match[1].length;
- }
- if (currentScope(state) == '(' && stream.match(/^\)/)) {
- state.scopes.pop();
- state.charsAdvanced += 1;
- if (state.scopes.length <= state.firstParenPos) {
- var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false);
- stream.backUp(state.charsAdvanced);
- state.firstParenPos = -1;
- state.charsAdvanced = 0;
- state.tokenize = tokenBase;
- if (isDefinition)
- return "def";
- return "builtin";
- }
- }
- // Unfortunately javascript does not support multiline strings, so we have
- // to undo anything done upto here if a function call or definition splits
- // over two or more lines.
- if (stream.match(/^$/g, false)) {
- stream.backUp(state.charsAdvanced);
- while (state.scopes.length > state.firstParenPos)
- state.scopes.pop();
- state.firstParenPos = -1;
- state.charsAdvanced = 0;
- state.tokenize = tokenBase;
- return "builtin";
- }
- state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
- return state.tokenize(stream, state);
- }
-
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) {
@@ -308,13 +274,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;
@@ -345,7 +311,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";
}
@@ -383,7 +349,6 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
nestedComments: 0,
nestedGenerators: 0,
nestedParameters: 0,
- charsAdvanced: 0,
firstParenPos: -1
};
},
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/lua/lua.js b/Mod manager/utils/QNModManager/CodeMirror/mode/lua/lua.js
index 202f3735..2fad0180 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/lua/lua.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/lua/lua.js
@@ -148,6 +148,7 @@ CodeMirror.defineMode("lua", function(config, parserConfig) {
return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0));
},
+ electricInput: /^\s*(?:end|until|else|\)|\})$/,
lineComment: "--",
blockCommentStart: "--[[",
blockCommentEnd: "]]"
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/index.html
index da3fe61b..4984c04b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/index.html
@@ -159,7 +159,7 @@ Markdown mode
Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
`+`, and `-`) as list markers. These three markers are
-interchangable; this:
+interchangeable; this:
* Candy.
* Gum.
@@ -306,7 +306,7 @@ Markdown mode
I strongly recommend against using any `<blink>` tags.
I wish SmartyPants used named entities like `—`
- instead of decimal-encoded entites like `—`.
+ instead of decimal-encoded entities like `—`.
Output:
@@ -315,7 +315,7 @@ Markdown mode
<p>I wish SmartyPants used named entities like
<code>&mdash;</code> instead of decimal-encoded
- entites like <code>&#8212;</code>.</p>
+ entities like <code>&#8212;</code>.</p>
To specify an entire block of pre-formatted code, indent every line of
@@ -360,7 +360,7 @@ Markdown mode
});
- If you also want support strikethrough
, emoji
and few other goodies, check out Github-Flavored Markdown mode .
+ If you also want support strikethrough
, emoji
and few other goodies, check out GitHub-Flavored Markdown mode .
Optionally depends on other modes for properly highlighted code blocks,
and XML mode for properly highlighted inline XML blocks.
@@ -370,7 +370,7 @@ Markdown mode
highlightFormatting: boolean
- Whether to separately highlight markdown meta characterts (*[]()
etc.) (default: false
).
+ Whether to separately highlight markdown meta characters (*[]()
etc.) (default: false
).
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/markdown.js b/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/markdown.js
index 287f39b5..a9e272ea 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/markdown.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/test.js b/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/test.js
index 929e7bba..fd5a1fb4 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/markdown/test.js
@@ -315,7 +315,7 @@
"[header&header-2 bar]",
"[header&header-2 ---]");
- MT("setextAferATX",
+ MT("setextAfterATX",
"[header&header-1 # foo]",
"[header&header-2 bar]",
"[header&header-2 ---]");
@@ -659,7 +659,7 @@
" [variable-2 text after fenced code]");
// should correctly parse numbered list content indentation
- MT("listCommonMark_NumeberedListIndent",
+ MT("listCommonMark_NumberedListIndent",
"[variable-2 1000. list with base indent of 6]",
"",
" [variable-2 text must be indented 6 spaces at minimum]",
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/meta.js b/Mod manager/utils/QNModManager/CodeMirror/mode/meta.js
index d3efdc17..38d5e013 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/meta.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/meta.js
@@ -19,7 +19,7 @@
{name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
- {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
+ {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy", "cbl"]},
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"]},
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
{name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
@@ -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"},
@@ -76,7 +76,7 @@
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
{name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
- {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
+ {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"], alias: ["jl"]},
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
@@ -169,7 +169,8 @@
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
{name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
{name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
- {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
+ {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]},
+ {name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]},
];
// Ensure all modes have a mime property for backwards compatibility
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/mllike/mllike.js b/Mod manager/utils/QNModManager/CodeMirror/mode/mllike/mllike.js
index a1538f72..8f923727 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/mllike/mllike.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/mllike/mllike.js
@@ -60,7 +60,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
}
}
if (ch === '(') {
- if (stream.eat('*')) {
+ if (stream.match(/^\*(?!\))/)) {
state.commentLevel++;
state.tokenize = tokenComment;
return state.tokenize(stream, state);
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/modelica/modelica.js b/Mod manager/utils/QNModManager/CodeMirror/mode/modelica/modelica.js
index a83a4135..2e9622f0 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/modelica/modelica.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/mscgen/mscgen.js b/Mod manager/utils/QNModManager/CodeMirror/mode/mscgen/mscgen.js
index 6f4f9cd8..8d39341c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/mscgen/mscgen.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/mumps/mumps.js b/Mod manager/utils/QNModManager/CodeMirror/mode/mumps/mumps.js
index 3671c9cb..c53b4bf3 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/mumps/mumps.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/nginx/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/nginx/index.html
index 5c2bc6e2..1aa690a6 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/nginx/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/nginx/index.html
@@ -62,7 +62,7 @@ NGINX mode
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cachable
+ expires 30d; ## Assume all files are cacheable
}
## These locations would be hidden by .htaccess normally
@@ -128,7 +128,7 @@ NGINX mode
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cachable
+ expires 30d; ## Assume all files are cacheable
}
## These locations would be hidden by .htaccess normally
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/nsis/nsis.js b/Mod manager/utils/QNModManager/CodeMirror/mode/nsis/nsis.js
index 636940f5..ebd3c8bf 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/nsis/nsis.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/nsis/nsis.js
@@ -24,42 +24,42 @@ CodeMirror.defineSimpleMode("nsis",{
{ regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
// Compile Time Commands
- {regex: /^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|pragma|finalize|getdllversion|gettlbversion|system|tempfile|warning|verbose|define|undef|insertmacro|macro|macroend|makensis|searchparse|searchreplace))\b/, token: "keyword"},
+ {regex: /^\s*(?:\!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|error|execute|finalize|getdllversion|gettlbversion|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|uninstfinalize|verbose|warning))\b/i, token: "keyword"},
// Conditional Compilation
- {regex: /^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
- {regex: /^\s*(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
+ {regex: /^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/i, token: "keyword", indent: true},
+ {regex: /^\s*(?:\!(else|endif|macroend))\b/i, token: "keyword", dedent: true},
// Runtime Commands
- {regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetKnownFolderPath|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfRtlLanguage|IfShellVarContextAll|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
- {regex: /^\s*(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
- {regex: /^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
+ {regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetKnownFolderPath|GetLabelAddress|GetTempFileName|GetWinVer|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfRtlLanguage|IfShellVarContextAll|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/i, token: "keyword"},
+ {regex: /^\s*(?:Function|PageEx|Section(?:Group)?)\b/i, token: "keyword", indent: true},
+ {regex: /^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/i, token: "keyword", dedent: true},
// Command Options
- {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
- {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
+ {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/i, token: "atom"},
+ {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/i, token: "builtin"},
// LogicLib.nsh
- {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
+ {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/i, token: "variable-2", indent: true},
// FileFunc.nsh
- {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
+ {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/i, token: "variable-2", dedent: true},
// Memento.nsh
- {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
+ {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/i, token: "variable-2", dedent: true},
// TextFunc.nsh
- {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
+ {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/i, token: "variable-2", dedent: true},
// WinVer.nsh
- {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
+ {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/i, token: "variable", dedent: true},
// WordFunc.nsh
- {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
+ {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/i, token: "variable-2", dedent: true},
// x64.nsh
- {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
- {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
+ {regex: /\$\{(?:RunningX64)\}/i, token: "variable", dedent: true},
+ {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/i, token: "variable-2", dedent: true},
// Line Comment
{regex: /(#|;).*/, token: "comment"},
@@ -71,20 +71,20 @@ CodeMirror.defineSimpleMode("nsis",{
{regex: /[-+\/*=<>!]+/, token: "operator"},
// Variable
- {regex: /\$\w+/, token: "variable"},
+ {regex: /\$\w[\w\.]*/, token: "variable"},
// Constant
- {regex: /\${[\w\.:-]+}/, token: "variable-2"},
+ {regex: /\${[\!\w\.:-]+}/, token: "variable-2"},
// Language String
- {regex: /\$\([\w\.:-]+\)/, token: "variable-3"}
+ {regex: /\$\([\!\w\.:-]+\)/, token: "variable-3"}
],
comment: [
{regex: /.*?\*\//, token: "comment", next: "start"},
{regex: /.*/, token: "comment"}
],
meta: {
- electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
+ electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/i,
blockCommentStart: "/*",
blockCommentEnd: "*/",
lineComment: ["#", ";"]
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/ntriples/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/ntriples/index.html
index 5473dbff..275cf08b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/ntriples/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/ntriples/index.html
@@ -58,7 +58,7 @@
"literal 1" .
_:bnode3 .
_:bnode4 "literal 2"@lang .
- # if a graph labe
+ # if a graph label
_:bnode5 "literal 3"^^ .
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/oz/oz.js b/Mod manager/utils/QNModManager/CodeMirror/mode/oz/oz.js
index a9738495..73857e4c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/oz/oz.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/pegjs/pegjs.js b/Mod manager/utils/QNModManager/CodeMirror/mode/pegjs/pegjs.js
index 19d5fa4c..ac011d3c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/pegjs/pegjs.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/perl/perl.js b/Mod manager/utils/QNModManager/CodeMirror/mode/perl/perl.js
index a3101a7c..41e7bc73 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/perl/perl.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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
@@ -513,10 +513,9 @@ CodeMirror.defineMode("perl",function(){
return null;
if(state.chain)
return tokenChain(stream,state,state.chain,state.style,state.tail);
- if(stream.match(/^\-?[\d\.]/,false))
- if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))
- return 'number';
- if(stream.match(/^<<(?=\w)/)){ // NOTE: <\w/, false)) {
+ if (stream.match(/^->\w/, false)) {
// Match object operator
state.tokenize = matchSequence([
[["->", null]],
@@ -80,13 +80,13 @@
}
var phpKeywords = "abstract and array as break case catch class clone const continue declare default " +
- "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " +
+ "do else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final " +
"for foreach function global goto if implements interface instanceof namespace " +
"new or private protected public static switch throw trait try use var while xor " +
"die echo empty exit eval include include_once isset list require require_once return " +
- "print unset __halt_compiler self static parent yield insteadof finally";
+ "print unset __halt_compiler self static parent yield insteadof finally readonly match";
var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
- var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
+ var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
CodeMirror.registerHelper("wordChars", "php", /[\w$]/);
@@ -95,7 +95,7 @@
helperType: "php",
keywords: keywords(phpKeywords),
blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
- defKeywords: keywords("class function interface namespace trait"),
+ defKeywords: keywords("class enum function interface namespace trait"),
atoms: keywords(phpAtoms),
builtin: keywords(phpBuiltin),
multiLineStrings: true,
@@ -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/Mod manager/utils/QNModManager/CodeMirror/mode/pug/pug.js b/Mod manager/utils/QNModManager/CodeMirror/mode/pug/pug.js
index a4c0e16b..73e9ae2f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/pug/pug.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/puppet/puppet.js b/Mod manager/utils/QNModManager/CodeMirror/mode/puppet/puppet.js
index 36493420..a92ca110 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/puppet/puppet.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/mode/python/index.html b/Mod manager/utils/QNModManager/CodeMirror/mode/python/index.html
index bdfc8f57..78a3a146 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/python/index.html
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/python/index.html
@@ -190,7 +190,7 @@ Configuration Options for Python mode:
hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
Advanced Configuration Options:
- Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help
+ Useful for superset of python syntax like Enthought enaml, IPython magics and questionmark help
- Im am a {{mustache-like}} template
+ I'm a {{mustache-like}} template
MIME types defined: text/webassembly
.
-
\ No newline at end of file
+
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/wast/test.js b/Mod manager/utils/QNModManager/CodeMirror/mode/wast/test.js
index 9998cfd9..0ebb388c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/wast/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/wast/test.js
@@ -21,7 +21,8 @@
'[string "foo #\\"# bar"]');
MT('atom-test',
- '[atom anyfunc]',
+ '[atom funcref]',
+ '[atom externref]',
'[atom i32]',
'[atom i64]',
'[atom f32]',
@@ -42,9 +43,18 @@
'[keyword br_table] [variable-2 $label0] [variable-2 $label1] [variable-2 $label3]',
'[keyword return]',
'[keyword call] [variable-2 $func0]',
- '[keyword call_indirect] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])',
+ '[keyword call_indirect] [variable-2 $table] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])',
'[keyword return_call] [variable-2 $func0]',
- '[keyword return_call_indirect] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])');
+ '[keyword return_call_indirect] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])',
+ '[keyword select] ([keyword local.get] [number 1]) ([keyword local.get] [number 2]) ([keyword local.get] [number 3])',
+ '[keyword try] ([keyword result] [atom i32])',
+ '[keyword throw] [number 0]',
+ '[keyword rethrow] [number 0]',
+ '[keyword catch] [number 0]',
+ '[keyword catch_all]',
+ '[keyword delegate] [number 0]',
+ '[keyword unwind]');
+
MT('memory-instructions',
'[keyword i32.load] [keyword offset]=[number 4] [keyword align]=[number 4]',
@@ -141,20 +151,20 @@
MT('simd-instructions',
'[keyword v128.load] [keyword offset]=[number 32] [keyword align]=[number 4]',
- '[keyword i16x8.load8x8_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword i16x8.load8x8_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword i32x4.load16x4_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword i32x4.load16x4_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword i64x2.load32x2_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword i64x2.load32x2_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword v8x16.load_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword v16x8.load_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword v32x4.load_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
- '[keyword v64x2.load_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load8x8_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load8x8_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load16x4_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load16x4_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load32x2_s] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load32x2_u] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load8_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load16_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load32_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load64_splat] [keyword offset]=[number 64] [keyword align]=[number 0]',
'[keyword v128.store] [keyword offset]=[number 32] [keyword align]=[number 4]',
'[keyword v128.const] [number 0] [number 1] [number 2] [number 3] [number 4] [number 5] [number 6] [number 7] [number 8] [number 9] [number 10] [number 11] [number 12] [number 13] [number 14] [number 15]',
- '[keyword v8x16.shuffle] [number 0] [number 1] [number 2] [number 3] [number 4] [number 5] [number 6] [number 7] [number 8] [number 9] [number 10] [number 11] [number 12] [number 13] [number 14] [number 15]',
- '[keyword v8x16.swizzle]',
+ '[keyword i8x16.shuffle] [number 0] [number 1] [number 2] [number 3] [number 4] [number 5] [number 6] [number 7] [number 8] [number 9] [number 10] [number 11] [number 12] [number 13] [number 14] [number 15]',
+ '[keyword i8x16.swizzle]',
'[keyword i8x16.splat]',
'[keyword i16x8.splat]',
'[keyword i32x4.splat]',
@@ -223,62 +233,90 @@
'[keyword v128.or]',
'[keyword v128.xor]',
'[keyword v128.bitselect]',
+ '[keyword v128.any_true]',
+ '[keyword v128.load8_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.load16_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.load32_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.load64_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.store8_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.store16_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.store32_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.store64_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]',
+ '[keyword v128.load32_zero] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword v128.load64_zero] [keyword offset]=[number 64] [keyword align]=[number 0]',
+ '[keyword f32x4.demote_f64x2_zero]',
+ '[keyword f64x2.promote_low_f32x4]',
'[keyword i8x16.abs]',
'[keyword i8x16.neg]',
- '[keyword i8x16.any_true]',
+ '[keyword i8x16.popcnt]',
'[keyword i8x16.all_true]',
'[keyword i8x16.bitmask]',
'[keyword i8x16.narrow_i16x8_s]',
'[keyword i8x16.narrow_i16x8_u]',
+ '[keyword f32x4.ceil]',
+ '[keyword f32x4.floor]',
+ '[keyword f32x4.trunc]',
+ '[keyword f32x4.nearest]',
'[keyword i8x16.shl]',
'[keyword i8x16.shr_s]',
'[keyword i8x16.shr_u]',
'[keyword i8x16.add]',
- '[keyword i8x16.add_saturate_s]',
- '[keyword i8x16.add_saturate_u]',
+ '[keyword i8x16.add_sat_s]',
+ '[keyword i8x16.add_sat_u]',
'[keyword i8x16.sub]',
- '[keyword i8x16.sub_saturate_s]',
- '[keyword i8x16.sub_saturate_u]',
+ '[keyword i8x16.sub_sat_s]',
+ '[keyword i8x16.sub_sat_u]',
+ '[keyword f64x2.ceil]',
+ '[keyword f64x2.floor]',
'[keyword i8x16.min_s]',
'[keyword i8x16.min_u]',
'[keyword i8x16.max_s]',
'[keyword i8x16.max_u]',
+ '[keyword f64x2.trunc]',
'[keyword i8x16.avgr_u]',
+ '[keyword i16x8.extadd_pairwise_i8x16_s]',
+ '[keyword i16x8.extadd_pairwise_i8x16_u]',
+ '[keyword i32x4.extadd_pairwise_i16x8_s]',
+ '[keyword i32x4.extadd_pairwise_i16x8_u]',
'[keyword i16x8.abs]',
'[keyword i16x8.neg]',
- '[keyword i16x8.any_true]',
+ '[keyword i16x8.q15mulr_sat_s]',
'[keyword i16x8.all_true]',
'[keyword i16x8.bitmask]',
'[keyword i16x8.narrow_i32x4_s]',
'[keyword i16x8.narrow_i32x4_u]',
- '[keyword i16x8.widen_low_i8x16_s]',
- '[keyword i16x8.widen_high_i8x16_s]',
- '[keyword i16x8.widen_low_i8x16_u]',
- '[keyword i16x8.widen_high_i8x16_u]',
+ '[keyword i16x8.extend_low_i8x16_s]',
+ '[keyword i16x8.extend_high_i8x16_s]',
+ '[keyword i16x8.extend_low_i8x16_u]',
+ '[keyword i16x8.extend_high_i8x16_u]',
'[keyword i16x8.shl]',
'[keyword i16x8.shr_s]',
'[keyword i16x8.shr_u]',
'[keyword i16x8.add]',
- '[keyword i16x8.add_saturate_s]',
- '[keyword i16x8.add_saturate_u]',
+ '[keyword i16x8.add_sat_s]',
+ '[keyword i16x8.add_sat_u]',
'[keyword i16x8.sub]',
- '[keyword i16x8.sub_saturate_s]',
- '[keyword i16x8.sub_saturate_u]',
+ '[keyword i16x8.sub_sat_s]',
+ '[keyword i16x8.sub_sat_u]',
+ '[keyword f64x2.nearest]',
'[keyword i16x8.mul]',
'[keyword i16x8.min_s]',
'[keyword i16x8.min_u]',
'[keyword i16x8.max_s]',
'[keyword i16x8.max_u]',
'[keyword i16x8.avgr_u]',
+ '[keyword i16x8.extmul_low_i8x16_s]',
+ '[keyword i16x8.extmul_high_i8x16_s]',
+ '[keyword i16x8.extmul_low_i8x16_u]',
+ '[keyword i16x8.extmul_high_i8x16_u]',
'[keyword i32x4.abs]',
'[keyword i32x4.neg]',
- '[keyword i32x4.any_true]',
'[keyword i32x4.all_true]',
'[keyword i32x4.bitmask]',
- '[keyword i32x4.widen_low_i16x8_s]',
- '[keyword i32x4.widen_high_i16x8_s]',
- '[keyword i32x4.widen_low_i16x8_u]',
- '[keyword i32x4.widen_high_i16x8_u]',
+ '[keyword i32x4.extend_low_i16x8_s]',
+ '[keyword i32x4.extend_high_i16x8_s]',
+ '[keyword i32x4.extend_low_i16x8_u]',
+ '[keyword i32x4.extend_high_i16x8_u]',
'[keyword i32x4.shl]',
'[keyword i32x4.shr_s]',
'[keyword i32x4.shr_u]',
@@ -289,13 +327,35 @@
'[keyword i32x4.min_u]',
'[keyword i32x4.max_s]',
'[keyword i32x4.max_u]',
+ '[keyword i32x4.dot_i16x8_s]',
+ '[keyword i32x4.extmul_low_i16x8_s]',
+ '[keyword i32x4.extmul_high_i16x8_s]',
+ '[keyword i32x4.extmul_low_i16x8_u]',
+ '[keyword i32x4.extmul_high_i16x8_u]',
+ '[keyword i64x2.abs]',
'[keyword i64x2.neg]',
+ '[keyword i64x2.all_true]',
+ '[keyword i64x2.bitmask]',
+ '[keyword i64x2.extend_low_i32x4_s]',
+ '[keyword i64x2.extend_high_i32x4_s]',
+ '[keyword i64x2.extend_low_i32x4_u]',
+ '[keyword i64x2.extend_high_i32x4_u]',
'[keyword i64x2.shl]',
'[keyword i64x2.shr_s]',
'[keyword i64x2.shr_u]',
'[keyword i64x2.add]',
'[keyword i64x2.sub]',
'[keyword i64x2.mul]',
+ '[keyword i64x2.eq]',
+ '[keyword i64x2.ne]',
+ '[keyword i64x2.lt_s]',
+ '[keyword i64x2.gt_s]',
+ '[keyword i64x2.le_s]',
+ '[keyword i64x2.ge_s]',
+ '[keyword i64x2.extmul_low_i32x4_s]',
+ '[keyword i64x2.extmul_high_i32x4_s]',
+ '[keyword i64x2.extmul_low_i32x4_u]',
+ '[keyword i64x2.extmul_high_i32x4_u]',
'[keyword f32x4.abs]',
'[keyword f32x4.neg]',
'[keyword f32x4.sqrt]',
@@ -317,5 +377,48 @@
'[keyword i32x4.trunc_sat_f32x4_s]',
'[keyword i32x4.trunc_sat_f32x4_u]',
'[keyword f32x4.convert_i32x4_s]',
- '[keyword f32x4.convert_i32x4_u]');
+ '[keyword f32x4.convert_i32x4_u]',
+ '[keyword i32x4.trunc_sat_f64x2_s_zero]',
+ '[keyword i32x4.trunc_sat_f64x2_u_zero]',
+ '[keyword f64x2.convert_low_i32x4_s]',
+ '[keyword f64x2.convert_low_i32x4_u]');
+
+ MT('reference-type-instructions',
+ '[keyword ref.null] [keyword extern]',
+ '[keyword ref.null] [keyword func]',
+ '[keyword ref.is_null] ([keyword ref.func] [variable-2 $f])',
+ '[keyword ref.func] [variable-2 $f]');
+
+ MT('table-instructions',
+ '[keyword table.get] [variable-2 $t] ([keyword i32.const] [number 5])',
+ '[keyword table.set] [variable-2 $t] ([keyword i32.const] [number 5]) ([keyword ref.func] [variable-2 $f])',
+ '[keyword table.size] [variable-2 $t]',
+ '[keyword table.grow] [variable-2 $t] ([keyword ref.null] [keyword extern]) ([keyword i32.const] [number 5])',
+ '[keyword table.fill] [variable-2 $t] ([keyword i32.const] [number 5]) ([keyword param] [variable-2 $r] [atom externref]) ([keyword i32.const] [number 5])',
+ '[keyword table.init] [variable-2 $t] [number 1] ([keyword i32.const] [number 5]) ([keyword i32.const] [number 10]) ([keyword i32.const] [number 15])',
+ '[keyword table.copy] [variable-2 $t] [variable-2 $t2] ([keyword i32.const] [number 5]) ([keyword i32.const] [number 10]) ([keyword i32.const] [number 15])'
+ );
+ MT('gc-proposal',
+ '[keyword call_ref] [keyword return_call_ref]',
+ '[keyword ref.as_non_null] [keyword br_on_null] [keyword ref.eq]');
+ MT('gc-proposal-structs',
+ '[keyword struct.new_with_rtt] [keyword struct.new_default_with_rtt]',
+ '[keyword struct.get] [keyword struct.get_s] [keyword struct.get_u]',
+ '[keyword struct.set]');
+ MT('gc-proposal-arrays',
+ '[keyword array.new_with_rtt] [keyword array.new_default_with_rtt]',
+ '[keyword array.get] [keyword array.get_s] [keyword array.get_u]',
+ '[keyword array.len] [keyword array.set]');
+ MT('gc-proposal-i31',
+ '[keyword i31.new] [keyword i31.get_s] [keyword i31.get_u]');
+ MT('gc-proposal-rtt',
+ '[keyword rtt.canon] [keyword rtt.sub]');
+ MT('gc-proposal-typechecks',
+ '[keyword ref.test] [keyword ref.cast] [keyword br_on_cast]',
+ '[keyword ref.is_func] [keyword ref.is_data] [keyword ref.is_i31]',
+ '[keyword ref.as_func] [keyword ref.as_data] [keyword ref.as_i31]',
+ '[keyword br_on_func] [keyword br_on_data] [keyword br_on_i31]');
+ MT('gc-proposal-types',
+ '[atom i8] [atom i16]',
+ '[atom anyref] [atom dataref] [atom eqref] [atom i31ref]');
})();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/wast/wast.js b/Mod manager/utils/QNModManager/CodeMirror/mode/wast/wast.js
index 9348ad3e..471ace5b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/wast/wast.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/wast/wast.js
@@ -11,11 +11,102 @@
})(function(CodeMirror) {
"use strict";
+var kKeywords = [
+ "align",
+ "block",
+ "br(_if|_table|_on_(cast|data|func|i31|null))?",
+ "call(_indirect|_ref)?",
+ "current_memory",
+ "\\bdata\\b",
+ "catch(_all)?",
+ "delegate",
+ "drop",
+ "elem",
+ "else",
+ "end",
+ "export",
+ "\\bextern\\b",
+ "\\bfunc\\b",
+ "global(\\.(get|set))?",
+ "if",
+ "import",
+ "local(\\.(get|set|tee))?",
+ "loop",
+ "module",
+ "mut",
+ "nop",
+ "offset",
+ "param",
+ "result",
+ "rethrow",
+ "return(_call(_indirect|_ref)?)?",
+ "select",
+ "start",
+ "table(\\.(size|get|set|size|grow|fill|init|copy))?",
+ "then",
+ "throw",
+ "try",
+ "type",
+ "unreachable",
+ "unwind",
+
+ // Numeric opcodes.
+ "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",
+ // Atomics.
+ "memory(\\.((atomic\\.(notify|wait(32|64)))|grow|size))?",
+ "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))",
+ // SIMD.
+ "v128\\.load(8x8|16x4|32x2)_[su]",
+ "v128\\.load(8|16|32|64)_splat",
+ "v128\\.(load|store)(8|16|32|64)_lane",
+ "v128\\.load(32|64)_zero",
+ "v128\.(load|store|const|not|andnot|and|or|xor|bitselect|any_true)",
+ "i(8x16|16x8)\\.(extract_lane_[su]|(add|sub)_sat_[su]|avgr_u)",
+ "i(8x16|16x8|32x4|64x2)\\.(neg|add|sub|abs|shl|shr_[su]|all_true|bitmask|eq|ne|[lg][te]_s)",
+ "(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane)",
+ "i(8x16|16x8|32x4)\\.(([lg][te]_u)|((min|max)_[su]))",
+ "f(32x4|64x2)\\.(neg|add|sub|abs|nearest|eq|ne|[lg][te]|sqrt|mul|div|min|max|ceil|floor|trunc)",
+ "[fi](32x4|64x2)\\.extract_lane",
+ "i8x16\\.(shuffle|swizzle|popcnt|narrow_i16x8_[su])",
+ "i16x8\\.(narrow_i32x4_[su]|mul|extadd_pairwise_i8x16_[su]|q15mulr_sat_s)",
+ "i16x8\\.(extend|extmul)_(low|high)_i8x16_[su]",
+ "i32x4\\.(mul|dot_i16x8_s|trunc_sat_f64x2_[su]_zero)",
+ "i32x4\\.((extend|extmul)_(low|high)_i16x8_|trunc_sat_f32x4_|extadd_pairwise_i16x8_)[su]",
+ "i64x2\\.(mul|(extend|extmul)_(low|high)_i32x4_[su])",
+ "f32x4\\.(convert_i32x4_[su]|demote_f64x2_zero)",
+ "f64x2\\.(promote_low_f32x4|convert_low_i32x4_[su])",
+ // Reference types, function references, and GC.
+ "\\bany\\b",
+ "array\\.len",
+ "(array|struct)(\\.(new_(default_)?with_rtt|get(_[su])?|set))?",
+ "\\beq\\b",
+ "field",
+ "i31\\.(new|get_[su])",
+ "\\bnull\\b",
+ "ref(\\.(([ai]s_(data|func|i31))|cast|eq|func|(is_|as_non_)?null|test))?",
+ "rtt(\\.(canon|sub))?",
+];
+
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|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: new RegExp(kKeywords.join('|')), token: "keyword"},
+ {regex: /\b((any|data|eq|extern|i31|func)ref|[fi](32|64)|i(8|16))\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/Mod manager/utils/QNModManager/CodeMirror/mode/xml/xml.js b/Mod manager/utils/QNModManager/CodeMirror/mode/xml/xml.js
index 73c6e0e0..4e36106b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/xml/xml.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/xml/xml.js
@@ -187,9 +187,13 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
};
}
+ function lower(tagName) {
+ return tagName && tagName.toLowerCase();
+ }
+
function Context(state, tagName, startOfLine) {
this.prev = state.context;
- this.tagName = tagName;
+ this.tagName = tagName || "";
this.indent = state.indented;
this.startOfLine = startOfLine;
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
@@ -205,8 +209,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
return;
}
parentTagName = state.context.tagName;
- if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
- !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||
+ !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {
return;
}
popContext(state);
@@ -240,7 +244,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
- config.implicitlyClosed.hasOwnProperty(state.context.tagName))
+ config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))
popContext(state);
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";
@@ -279,7 +283,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
- config.autoSelfClosers.hasOwnProperty(tagName)) {
+ config.autoSelfClosers.hasOwnProperty(lower(tagName))) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
@@ -359,7 +363,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
- } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
+ } else if (config.implicitlyClosed.hasOwnProperty(lower(context.tagName))) {
context = context.prev;
} else {
break;
@@ -367,8 +371,8 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
- var grabbers = config.contextGrabbers[context.tagName];
- if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
+ var grabbers = config.contextGrabbers[lower(context.tagName)];
+ if (grabbers && grabbers.hasOwnProperty(lower(tagAfter[2])))
context = context.prev;
else
break;
@@ -399,7 +403,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
xmlCurrentContext: function(state) {
var context = []
for (var cx = state.context; cx; cx = cx.prev)
- if (cx.tagName) context.push(cx.tagName)
+ context.push(cx.tagName)
return context.reverse()
}
};
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/yaml-frontmatter/yaml-frontmatter.js b/Mod manager/utils/QNModManager/CodeMirror/mode/yaml-frontmatter/yaml-frontmatter.js
index 87fdf80d..5c6175e4 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/yaml-frontmatter/yaml-frontmatter.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/mode/yaml-frontmatter/yaml-frontmatter.js
@@ -17,51 +17,55 @@
var yamlMode = CodeMirror.getMode(config, "yaml")
var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm")
- function curMode(state) {
- return state.state == BODY ? innerMode : yamlMode
+ function localMode(state) {
+ return state.state == FRONTMATTER ? {mode: yamlMode, state: state.yaml} : {mode: innerMode, state: state.inner}
}
return {
startState: function () {
return {
state: START,
- inner: CodeMirror.startState(yamlMode)
+ yaml: null,
+ inner: CodeMirror.startState(innerMode)
}
},
copyState: function (state) {
return {
state: state.state,
- inner: CodeMirror.copyState(curMode(state), state.inner)
+ yaml: state.yaml && CodeMirror.copyState(yamlMode, state.yaml),
+ inner: CodeMirror.copyState(innerMode, state.inner)
}
},
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)
+ state.yaml = CodeMirror.startState(yamlMode)
+ return yamlMode.token(stream, state.yaml)
} else {
state.state = BODY
- state.inner = CodeMirror.startState(innerMode)
return innerMode.token(stream, state.inner)
}
} else if (state.state == FRONTMATTER) {
var end = stream.sol() && stream.match(/(---|\.\.\.)/, false)
- var style = yamlMode.token(stream, state.inner)
+ var style = yamlMode.token(stream, state.yaml)
if (end) {
state.state = BODY
- state.inner = CodeMirror.startState(innerMode)
+ state.yaml = null
}
return style
} else {
return innerMode.token(stream, state.inner)
}
},
- innerMode: function (state) {
- return {mode: curMode(state), state: state.inner}
+ innerMode: localMode,
+ indent: function(state, a, b) {
+ var m = localMode(state)
+ return m.mode.indent ? m.mode.indent(m.state, a, b) : CodeMirror.Pass
},
blankLine: function (state) {
- var mode = curMode(state)
- if (mode.blankLine) return mode.blankLine(state.inner)
+ var m = localMode(state)
+ if (m.mode.blankLine) return m.mode.blankLine(m.state)
}
}
})
diff --git a/Mod manager/utils/QNModManager/CodeMirror/mode/yaml/yaml.js b/Mod manager/utils/QNModManager/CodeMirror/mode/yaml/yaml.js
index a29d7ea4..d4649410 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/mode/yaml/yaml.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/package.json b/Mod manager/utils/QNModManager/CodeMirror/package.json
index faf0ca08..43295d37 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/package.json
+++ b/Mod manager/utils/QNModManager/CodeMirror/package.json
@@ -1,6 +1,6 @@
{
"name": "codemirror",
- "version": "5.57.0",
+ "version": "5.65.2",
"main": "lib/codemirror.js",
"style": "lib/codemirror.css",
"author": {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/addon/runmode/codemirror-standalone.js b/Mod manager/utils/QNModManager/CodeMirror/src/addon/runmode/codemirror-standalone.js
index b463a5cf..f13f32b2 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/addon/runmode/codemirror-standalone.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/addon/runmode/codemirror-standalone.js
@@ -1,4 +1,5 @@
import StringStream from "../../util/StringStream.js"
+import { countColumn } from "../../util/misc.js"
import * as modeMethods from "../../modes.js"
// declare global: globalThis, CodeMirror
@@ -17,6 +18,7 @@ CodeMirror.defineMIME("text/plain", "null")
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) }
+CodeMirror.countColumn = countColumn
CodeMirror.defaults = { indentUnit: 2 }
export default CodeMirror
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/Display.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/Display.js
index d57f00bd..9d4c0360 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/Display.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/Display.js
@@ -49,6 +49,10 @@ export function Display(place, doc, input, options) {
// The element in which the editor lives.
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
+ // This attribute is respected by automatic translation systems such as Google Translate,
+ // and may also be respected by tools used by human translators.
+ d.wrapper.setAttribute('translate', 'no')
+
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
if (!webkit && !(gecko && mobile)) d.scroller.draggable = true
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/focus.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/focus.js
index aa731b43..0337327e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/focus.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/focus.js
@@ -4,19 +4,22 @@ import { addClass, rmClass } from "../util/dom.js"
import { signal } from "../util/event.js"
export function ensureFocus(cm) {
- if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }
+ if (!cm.hasFocus()) {
+ cm.display.input.focus()
+ if (!cm.state.focused) onFocus(cm)
+ }
}
export function delayBlurEvent(cm) {
cm.state.delayingBlurEvent = true
setTimeout(() => { if (cm.state.delayingBlurEvent) {
cm.state.delayingBlurEvent = false
- onBlur(cm)
+ if (cm.state.focused) onBlur(cm)
} }, 100)
}
export function onFocus(cm, e) {
- if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false
+ if (cm.state.delayingBlurEvent && !cm.state.draggingText) cm.state.delayingBlurEvent = false
if (cm.options.readOnly == "nocursor") return
if (!cm.state.focused) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/operations.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/operations.js
index 6f3c9d08..79396e9b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/operations.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/operations.js
@@ -36,7 +36,8 @@ export function startOperation(cm) {
scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
scrollToPos: null, // Used to scroll to a specific position
focus: false,
- id: ++nextOpId // Unique ID
+ id: ++nextOpId, // Unique ID
+ markArrays: null // Used by addMarkedSpan
}
pushOperation(cm.curOp)
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/scroll_events.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/scroll_events.js
index fbed4266..5c6173ac 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/scroll_events.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/scroll_events.js
@@ -41,6 +41,12 @@ export function wheelEventPixels(e) {
export function onScrollWheel(cm, e) {
let delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
+ let pixelsPerUnit = wheelPixelsPerUnit
+ if (e.deltaMode === 0) {
+ dx = e.deltaX
+ dy = e.deltaY
+ pixelsPerUnit = 1
+ }
let display = cm.display, scroll = display.scroller
// Quit if there's nothing to scroll here
@@ -69,10 +75,10 @@ export function onScrollWheel(cm, e) {
// estimated pixels/delta value, we just handle horizontal
// scrolling entirely here. It'll be slightly off from native, but
// better than glitching out.
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
+ if (dx && !gecko && !presto && pixelsPerUnit != null) {
if (dy && canScrollY)
- updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit))
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))
+ updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit))
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit))
// Only prevent default scrolling if vertical scrolling is
// actually possible. Otherwise, it causes vertical scroll
// jitter on OSX trackpads when deltaX is small and deltaY
@@ -85,15 +91,15 @@ export function onScrollWheel(cm, e) {
// 'Project' the visible viewport to cover the area that is being
// scrolled into view (if we know enough to estimate it).
- if (dy && wheelPixelsPerUnit != null) {
- let pixels = dy * wheelPixelsPerUnit
+ if (dy && pixelsPerUnit != null) {
+ let pixels = dy * pixelsPerUnit
let top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
if (pixels < 0) top = Math.max(0, top + pixels - 50)
else bot = Math.min(cm.doc.height, bot + pixels + 50)
updateDisplaySimple(cm, {top: top, bottom: bot})
}
- if (wheelSamples < 20) {
+ if (wheelSamples < 20 && e.deltaMode !== 0) {
if (display.wheelStartX == null) {
display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
display.wheelDX = dx; display.wheelDY = dy
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/scrollbars.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/scrollbars.js
index 18ac121a..f77ffc19 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/scrollbars.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/scrollbars.js
@@ -60,6 +60,7 @@ class NativeScrollbars {
this.vert.firstChild.style.height =
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
} else {
+ this.vert.scrollTop = 0
this.vert.style.display = ""
this.vert.firstChild.style.height = "0"
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/scrolling.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/scrolling.js
index 6d97247d..27d6f70c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/scrolling.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/scrolling.js
@@ -39,8 +39,8 @@ export function scrollPosIntoView(cm, pos, end, margin) {
// Set pos and end to the cursor positions around the character pos sticks to
// If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
// If pos == Pos(_, 0, "before"), pos and end are unchanged
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
}
for (let limit = 0; limit < 5; limit++) {
let changed = false
@@ -91,14 +91,15 @@ function calculateScrollPos(cm, rect) {
if (newTop != screentop) result.scrollTop = newTop
}
- let screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
- let screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
+ let gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth
+ let screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace
+ let screenw = displayWidth(cm) - display.gutters.offsetWidth
let tooWide = rect.right - rect.left > screenw
if (tooWide) rect.right = rect.left + screenw
if (rect.left < 10)
result.scrollLeft = 0
else if (rect.left < screenleft)
- result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10))
+ result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10))
else if (rect.right > screenw + screenleft - 3)
result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw
return result
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/selection.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/selection.js
index c658c0a2..f53c7907 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/selection.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/selection.js
@@ -4,6 +4,7 @@ import { getLine } from "../line/utils_line.js"
import { charCoords, cursorCoords, displayWidth, paddingH, wrappedLineExtentChar } from "../measurement/position_measurement.js"
import { getOrder, iterateBidiSections } from "../util/bidi.js"
import { elt } from "../util/dom.js"
+import { onBlur } from "./focus.js"
export function updateSelection(cm) {
cm.display.input.showSelection(cm.display.input.prepareSelection())
@@ -14,13 +15,19 @@ export function prepareSelection(cm, primary = true) {
let curFragment = result.cursors = document.createDocumentFragment()
let selFragment = result.selection = document.createDocumentFragment()
+ let customCursor = cm.options.$customCursor
+ if (customCursor) primary = true
for (let i = 0; i < doc.sel.ranges.length; i++) {
if (!primary && i == doc.sel.primIndex) continue
let range = doc.sel.ranges[i]
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue
let collapsed = range.empty()
- if (collapsed || cm.options.showCursorWhenSelecting)
+ if (customCursor) {
+ let head = customCursor(cm, range)
+ if (head) drawSelectionCursor(cm, head, curFragment)
+ } else if (collapsed || cm.options.showCursorWhenSelecting) {
drawSelectionCursor(cm, range.head, curFragment)
+ }
if (!collapsed)
drawSelectionRange(cm, range, selFragment)
}
@@ -36,6 +43,12 @@ export function drawSelectionCursor(cm, head, output) {
cursor.style.top = pos.top + "px"
cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
+ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
+ let charPos = charCoords(cm, head, "div", null, null)
+ let width = charPos.right - charPos.left
+ cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"
+ }
+
if (pos.other) {
// Secondary cursor, shown when on a 'jump' in bi-directional text
let otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
@@ -151,8 +164,10 @@ export function restartBlink(cm) {
let on = true
display.cursorDiv.style.visibility = ""
if (cm.options.cursorBlinkRate > 0)
- display.blinker = setInterval(() => display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden",
- cm.options.cursorBlinkRate)
+ display.blinker = setInterval(() => {
+ if (!cm.hasFocus()) onBlur(cm)
+ display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"
+ }, cm.options.cursorBlinkRate)
else if (cm.options.cursorBlinkRate < 0)
display.cursorDiv.style.visibility = "hidden"
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_display.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_display.js
index e6c21a0a..83c25407 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_display.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_display.js
@@ -5,6 +5,7 @@ import { displayHeight, displayWidth, getDimensions, paddingVert, scrollGap } fr
import { mac, webkit } from "../util/browser.js"
import { activeElt, removeChildren, contains } from "../util/dom.js"
import { hasHandler, signal } from "../util/event.js"
+import { signalLater } from "../util/operation_group.js"
import { indexOf } from "../util/misc.js"
import { buildLineElement, updateLineForChanges } from "./update_line.js"
@@ -254,6 +255,8 @@ function patchDisplay(cm, updateNumbersFrom, dims) {
export function updateGutterSpace(display) {
let width = display.gutters.offsetWidth
display.sizer.style.marginLeft = width + "px"
+ // Send an event to consumers responding to changes in gutter width.
+ signalLater(display, "gutterChanged", display)
}
export function setDocumentHeight(cm, measure) {
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_line.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_line.js
index 50d781ee..dd1aac8b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_line.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_line.js
@@ -104,6 +104,7 @@ function updateLineGutter(cm, lineView, lineN, dims) {
if (cm.options.lineNumbers || markers) {
let wrap = ensureLineWrapped(lineView)
let gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", `left: ${cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth}px`)
+ gutterWrap.setAttribute("aria-hidden", "true")
cm.display.input.setUneditable(gutterWrap)
wrap.insertBefore(gutterWrap, lineView.text)
if (lineView.line.gutterClass)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_lines.js b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_lines.js
index 60c367e4..f09524b6 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/display/update_lines.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/display/update_lines.js
@@ -8,10 +8,14 @@ import { ie, ie_version } from "../util/browser.js"
export function updateHeightsInViewport(cm) {
let display = cm.display
let prevBottom = display.lineDiv.offsetTop
+ let viewTop = Math.max(0, display.scroller.getBoundingClientRect().top)
+ let oldHeight = display.lineDiv.getBoundingClientRect().top
+ let mustScroll = 0
for (let i = 0; i < display.view.length; i++) {
let cur = display.view[i], wrapping = cm.options.lineWrapping
let height, width = 0
if (cur.hidden) continue
+ oldHeight += cur.line.height
if (ie && ie_version < 8) {
let bot = cur.node.offsetTop + cur.node.offsetHeight
height = bot - prevBottom
@@ -26,6 +30,7 @@ export function updateHeightsInViewport(cm) {
}
let diff = cur.line.height - height
if (diff > .005 || diff < -.005) {
+ if (oldHeight < viewTop) mustScroll -= diff
updateLineHeight(cur.line, height)
updateWidgetHeight(cur.line)
if (cur.rest) for (let j = 0; j < cur.rest.length; j++)
@@ -40,6 +45,7 @@ export function updateHeightsInViewport(cm) {
}
}
}
+ if (Math.abs(mustScroll) > 2) display.scroller.scrollTop += mustScroll
}
// Read and store the height of line widgets associated with the
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/CodeMirror.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/CodeMirror.js
index 3429da1e..dc016113 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/CodeMirror.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/edit/CodeMirror.js
@@ -14,7 +14,7 @@ import { Range } from "../model/selection.js"
import { extendSelection } from "../model/selection_updates.js"
import { ie, ie_version, mobile, webkit } from "../util/browser.js"
import { e_preventDefault, e_stop, on, signal, signalDOMEvent } from "../util/event.js"
-import { bind, copyObj, Delayed } from "../util/misc.js"
+import { copyObj, Delayed } from "../util/misc.js"
import { clearDragCursor, onDragOver, onDragStart, onDrop } from "./drop_events.js"
import { ensureGlobalHandlers } from "./global_events.js"
@@ -76,7 +76,9 @@ export function CodeMirror(place, options) {
attachDoc(this, doc)
if ((options.autofocus && !mobile) || this.hasFocus())
- setTimeout(bind(onFocus, this), 20)
+ setTimeout(() => {
+ if (this.hasFocus() && !this.state.focused) onFocus(this)
+ }, 20)
else
onBlur(this)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/commands.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/commands.js
index 079379fc..4c4cc4cd 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/commands.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/edit/commands.js
@@ -84,7 +84,7 @@ export let commands = {
goGroupRight: cm => cm.moveH(1, "group"),
goGroupLeft: cm => cm.moveH(-1, "group"),
goWordRight: cm => cm.moveH(1, "word"),
- delCharBefore: cm => cm.deleteH(-1, "char"),
+ delCharBefore: cm => cm.deleteH(-1, "codepoint"),
delCharAfter: cm => cm.deleteH(1, "char"),
delWordBefore: cm => cm.deleteH(-1, "word"),
delWordAfter: cm => cm.deleteH(1, "word"),
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/main.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/main.js
index 64e94929..677fe67c 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/main.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/edit/main.js
@@ -66,4 +66,4 @@ import { addLegacyProps } from "./legacy.js"
addLegacyProps(CodeMirror)
-CodeMirror.version = "5.57.0"
+CodeMirror.version = "5.65.2"
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/methods.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/methods.js
index acf90d1c..c33a8598 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/methods.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/edit/methods.js
@@ -457,14 +457,14 @@ export default function(CodeMirror) {
}
// Used for horizontal relative motion. Dir is -1 or 1 (left or
-// right), unit can be "char", "column" (like char, but doesn't
-// cross line boundaries), "word" (across next word), or "group" (to
-// the start of next group of word or non-word-non-whitespace
-// chars). The visually param controls whether, in right-to-left
-// text, direction 1 means to move towards the next index in the
-// string, or towards the character to the right of the current
-// position. The resulting position will have a hitSide=true
-// property if it reached the end of the document.
+// right), unit can be "codepoint", "char", "column" (like char, but
+// doesn't cross line boundaries), "word" (across next word), or
+// "group" (to the start of next group of word or
+// non-word-non-whitespace chars). The visually param controls
+// whether, in right-to-left text, direction 1 means to move towards
+// the next index in the string, or towards the character to the right
+// of the current position. The resulting position will have a
+// hitSide=true property if it reached the end of the document.
function findPosH(doc, pos, dir, unit, visually) {
let oldPos = pos
let origDir = dir
@@ -478,7 +478,15 @@ function findPosH(doc, pos, dir, unit, visually) {
}
function moveOnce(boundToLine) {
let next
- if (visually) {
+ if (unit == "codepoint") {
+ let ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1))
+ if (isNaN(ch)) {
+ next = null
+ } else {
+ let astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF
+ next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir)
+ }
+ } else if (visually) {
next = moveVisually(doc.cm, lineObj, pos, dir)
} else {
next = moveLogically(lineObj, pos, dir)
@@ -494,7 +502,7 @@ function findPosH(doc, pos, dir, unit, visually) {
return true
}
- if (unit == "char") {
+ if (unit == "char" || unit == "codepoint") {
moveOnce()
} else if (unit == "column") {
moveOnce(true)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/mouse_events.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/mouse_events.js
index 5fcc4370..b5d0b5a6 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/mouse_events.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/edit/mouse_events.js
@@ -149,6 +149,10 @@ function leftButtonStartDrag(cm, event, pos, behavior) {
let dragEnd = operation(cm, e => {
if (webkit) display.scroller.draggable = false
cm.state.draggingText = false
+ if (cm.state.delayingBlurEvent) {
+ if (cm.hasFocus()) cm.state.delayingBlurEvent = false
+ else delayBlurEvent(cm)
+ }
off(display.wrapper.ownerDocument, "mouseup", dragEnd)
off(display.wrapper.ownerDocument, "mousemove", mouseMove)
off(display.scroller, "dragstart", dragStart)
@@ -172,15 +176,15 @@ function leftButtonStartDrag(cm, event, pos, behavior) {
if (webkit) display.scroller.draggable = true
cm.state.draggingText = dragEnd
dragEnd.copy = !behavior.moveOnDrag
- // IE's approach to draggable
- if (display.scroller.dragDrop) display.scroller.dragDrop()
on(display.wrapper.ownerDocument, "mouseup", dragEnd)
on(display.wrapper.ownerDocument, "mousemove", mouseMove)
on(display.scroller, "dragstart", dragStart)
on(display.scroller, "drop", dragEnd)
- delayBlurEvent(cm)
+ cm.state.delayingBlurEvent = true
setTimeout(() => display.input.focus(), 20)
+ // IE's approach to draggable
+ if (display.scroller.dragDrop) display.scroller.dragDrop()
}
function rangeForUnit(cm, pos, unit) {
@@ -193,6 +197,7 @@ function rangeForUnit(cm, pos, unit) {
// Normal selection, as opposed to text dragging.
function leftButtonSelect(cm, event, start, behavior) {
+ if (ie) delayBlurEvent(cm)
let display = cm.display, doc = cm.doc
e_preventDefault(event)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/edit/options.js b/Mod manager/utils/QNModManager/CodeMirror/src/edit/options.js
index 400e0003..8cb9cee0 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/edit/options.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/src/input/ContentEditableInput.js b/Mod manager/utils/QNModManager/CodeMirror/src/input/ContentEditableInput.js
index b50073ec..4845a4eb 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/input/ContentEditableInput.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/input/ContentEditableInput.js
@@ -10,7 +10,7 @@ import { simpleSelection } from "../model/selection.js"
import { setSelection } from "../model/selection_updates.js"
import { getBidiPartAt, getOrder } from "../util/bidi.js"
import { android, chrome, gecko, ie_version } from "../util/browser.js"
-import { contains, range, removeChildrenAndAdd, selectInput } from "../util/dom.js"
+import { activeElt, contains, range, removeChildrenAndAdd, selectInput } from "../util/dom.js"
import { on, signalDOMEvent } from "../util/event.js"
import { Delayed, lst, sel_dontScroll } from "../util/misc.js"
@@ -29,6 +29,7 @@ export default class ContentEditableInput {
init(display) {
let input = this, cm = input.cm
let div = input.div = display.lineDiv
+ div.contentEditable = true
disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize)
function belongsToInput(e) {
@@ -95,7 +96,7 @@ export default class ContentEditableInput {
let kludge = hiddenTextarea(), te = kludge.firstChild
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
te.value = lastCopied.text.join("\n")
- let hadFocus = document.activeElement
+ let hadFocus = activeElt()
selectInput(te)
setTimeout(() => {
cm.display.lineSpace.removeChild(kludge)
@@ -118,7 +119,7 @@ export default class ContentEditableInput {
prepareSelection() {
let result = prepareSelection(this.cm, false)
- result.focus = document.activeElement == this.div
+ result.focus = activeElt() == this.div
return result
}
@@ -212,7 +213,7 @@ export default class ContentEditableInput {
focus() {
if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor() || document.activeElement != this.div)
+ if (!this.selectionInEditor() || activeElt() != this.div)
this.showSelection(this.prepareSelection(), true)
this.div.focus()
}
@@ -225,7 +226,7 @@ export default class ContentEditableInput {
receivedFocus() {
let input = this
if (this.selectionInEditor())
- this.pollSelection()
+ setTimeout(() => this.pollSelection(), 20)
else
runInOp(this.cm, () => input.cm.curOp.selectionChanged = true)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/input/TextareaInput.js b/Mod manager/utils/QNModManager/CodeMirror/src/input/TextareaInput.js
index 8fe14bb4..977eb227 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/input/TextareaInput.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/input/TextareaInput.js
@@ -366,6 +366,7 @@ export default class TextareaInput {
readOnlyChanged(val) {
if (!val) this.reset()
this.textarea.disabled = val == "nocursor"
+ this.textarea.readOnly = !!val
}
setUneditable() {}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/input/input.js b/Mod manager/utils/QNModManager/CodeMirror/src/input/input.js
index 32adbf9b..288937be 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/input/input.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/input/input.js
@@ -120,7 +120,7 @@ export function disableBrowserMagic(field, spellcheck, autocorrect, autocapitali
}
export function hiddenTextarea() {
- let te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none")
+ let te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none")
let div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;")
// The textarea is kept positioned near the cursor to prevent the
// fact that it'll be scrolled into view on input from scrolling
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/input/keymap.js b/Mod manager/utils/QNModManager/CodeMirror/src/input/keymap.js
index f29f2bb1..2df588de 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/input/keymap.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/input/keymap.js
@@ -29,10 +29,9 @@ keyMap.pcDefault = {
// Very basic readline/emacs-style bindings, which are standard on Mac.
keyMap.emacsy = {
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
- "Ctrl-O": "openLine"
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
+ "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
+ "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
}
keyMap.macDefault = {
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/line/line_data.js b/Mod manager/utils/QNModManager/CodeMirror/src/line/line_data.js
index 20dd4328..e650b3e3 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/line/line_data.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/line/line_data.js
@@ -178,7 +178,7 @@ function buildToken(builder, text, style, startStyle, endStyle, css, attributes)
}
}
builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
- if (style || startStyle || endStyle || mustWrap || css) {
+ if (style || startStyle || endStyle || mustWrap || css || attributes) {
let fullStyle = style || ""
if (startStyle) fullStyle += startStyle
if (endStyle) fullStyle += endStyle
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/line/spans.js b/Mod manager/utils/QNModManager/CodeMirror/src/line/spans.js
index d81dec4b..ac17bf6b 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/line/spans.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/line/spans.js
@@ -18,6 +18,7 @@ export function getMarkedSpanFor(spans, marker) {
if (span.marker == marker) return span
}
}
+
// Remove a span from an array, returning undefined if no spans are
// left (we don't store arrays for lines without spans).
export function removeMarkedSpan(spans, span) {
@@ -26,9 +27,16 @@ export function removeMarkedSpan(spans, span) {
if (spans[i] != span) (r || (r = [])).push(spans[i])
return r
}
+
// Add a span to a line.
-export function addMarkedSpan(line, span) {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
+export function addMarkedSpan(line, span, op) {
+ let inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet))
+ if (inThisOp && inThisOp.has(line.markedSpans)) {
+ line.markedSpans.push(span)
+ } else {
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
+ if (inThisOp) inThisOp.add(line.markedSpans)
+ }
span.marker.attachLine(line)
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/measurement/position_measurement.js b/Mod manager/utils/QNModManager/CodeMirror/src/measurement/position_measurement.js
index bb0ad50d..2766fb79 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/measurement/position_measurement.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/measurement/position_measurement.js
@@ -61,12 +61,14 @@ function ensureLineHeights(cm, lineView, rect) {
export function mapFromLineView(lineView, line, lineN) {
if (lineView.line == line)
return {map: lineView.measure.map, cache: lineView.measure.cache}
- for (let i = 0; i < lineView.rest.length; i++)
- if (lineView.rest[i] == line)
- return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}
- for (let i = 0; i < lineView.rest.length; i++)
- if (lineNo(lineView.rest[i]) > lineN)
- return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}
+ if (lineView.rest) {
+ for (let i = 0; i < lineView.rest.length; i++)
+ if (lineView.rest[i] == line)
+ return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}
+ for (let i = 0; i < lineView.rest.length; i++)
+ if (lineNo(lineView.rest[i]) > lineN)
+ return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}
+ }
}
// Render a line into the hidden node display.externalMeasured. Used
@@ -293,9 +295,9 @@ function pageScrollY() {
}
function widgetTopHeight(lineObj) {
- let height = 0
- if (lineObj.widgets) for (let i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above)
- height += widgetHeight(lineObj.widgets[i])
+ let {widgets} = visualLine(lineObj), height = 0
+ if (widgets) for (let i = 0; i < widgets.length; ++i) if (widgets[i].above)
+ height += widgetHeight(widgets[i])
return height
}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/model/Doc.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/Doc.js
index c305eee2..3d2f7d23 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/Doc.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/model/Doc.js
@@ -86,6 +86,7 @@ Doc.prototype = createObj(BranchChunk.prototype, {
getRange: function(from, to, lineSep) {
let lines = getBetween(this, clipPos(this, from), clipPos(this, to))
if (lineSep === false) return lines
+ if (lineSep === '') return lines.join('')
return lines.join(lineSep || this.lineSeparator())
},
@@ -137,7 +138,7 @@ Doc.prototype = createObj(BranchChunk.prototype, {
let out = []
for (let i = 0; i < ranges.length; i++)
out[i] = new Range(clipPos(this, ranges[i].anchor),
- clipPos(this, ranges[i].head))
+ clipPos(this, ranges[i].head || ranges[i].anchor))
if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex)
setSelection(this, normalizeSelection(this.cm, out, primary), options)
}),
@@ -198,7 +199,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 +220,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/Mod manager/utils/QNModManager/CodeMirror/src/model/document_data.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/document_data.js
index d946e7af..c4204828 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/document_data.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/model/document_data.js
@@ -94,6 +94,7 @@ export function attachDoc(cm, doc) {
estimateLineHeights(cm)
loadMode(cm)
setDirectionClass(cm)
+ cm.options.direction = doc.direction
if (!cm.options.lineWrapping) findMaxLine(cm)
cm.options.mode = doc.modeOption
regChange(cm)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/model/history.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/history.js
index 2d9359f0..a5bfbb38 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/history.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/src/model/line_widget.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/line_widget.js
index 5444d89d..f94727e5 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/line_widget.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/model/line_widget.js
@@ -63,7 +63,7 @@ export function addLineWidget(doc, handle, node, options) {
changeLine(doc, handle, "widget", line => {
let widgets = line.widgets || (line.widgets = [])
if (widget.insertAt == null) widgets.push(widget)
- else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget)
+ else widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget)
widget.line = line
if (cm && !lineIsHidden(doc, line)) {
let aboveVisible = heightAtLine(line) < doc.scrollTop
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/model/mark_text.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/mark_text.js
index 088f9c98..64d40d29 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/mark_text.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/model/mark_text.js
@@ -187,7 +187,7 @@ export function markText(doc, from, to, options, type) {
if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0)
addMarkedSpan(line, new MarkedSpan(marker,
curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null))
+ curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp)
++curLine
})
// lineIsHidden depends on the presence of the spans, so needs a second pass
diff --git a/Mod manager/utils/QNModManager/CodeMirror/src/model/selection_updates.js b/Mod manager/utils/QNModManager/CodeMirror/src/model/selection_updates.js
index 4db2bd7f..3f399e5f 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/model/selection_updates.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/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/Mod manager/utils/QNModManager/CodeMirror/src/util/browser.js b/Mod manager/utils/QNModManager/CodeMirror/src/util/browser.js
index 9fc4602c..ae9d6af7 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/src/util/browser.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/src/util/browser.js
@@ -17,7 +17,7 @@ export let safari = /Apple Computer/.test(navigator.vendor)
export let mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
export let phantom = /PhantomJS/.test(userAgent)
-export let ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
+export let ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2)
export let android = /Android/.test(userAgent)
// This is woefully incomplete. Suggestions for alternative methods welcome.
export let mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
diff --git a/Mod manager/utils/QNModManager/CodeMirror/test/emacs_test.js b/Mod manager/utils/QNModManager/CodeMirror/test/emacs_test.js
index 412dba4b..4d2fde68 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/test/emacs_test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/test/emacs_test.js
@@ -39,6 +39,8 @@
}, {keyMap: "emacs", value: start, mode: "javascript"});
}
+ function dialog(answer) { return function(cm) { cm.openDialog = function(_, cb) { cb(answer); }; }; }
+
function at(line, ch, sticky) { return function(cm) { eqCursorPos(cm.getCursor(), Pos(line, ch, sticky)); }; }
function txt(str) { return function(cm) { eq(cm.getValue(), str); }; }
@@ -133,6 +135,19 @@
sim("backspaceDoesntAddToRing", "foobar", "Ctrl-F", "Ctrl-F", "Ctrl-F", "Ctrl-K", "Backspace", "Backspace", "Ctrl-Y", txt("fbar"));
+ sim("gotoLine", "0\n1\n2\n3", dialog("3"), "Alt-G", "G", at(2, 0));
+ sim("gotoInvalidLineFloat", "0\n1\n2\n3", dialog("2.2"), "Alt-G", "G", at(0, 0));
+
+ testCM("gotoDialogTemplate", function(cm) {
+ cm.openDialog = function(template, cb) {
+ var input = template.querySelector("input");
+ eq(template.textContent, "Goto line: ");
+ eq(input.tagName, "INPUT");
+ };
+ cm.triggerOnKeyDown(fakeEvent("Alt-G"));
+ cm.triggerOnKeyDown(fakeEvent("G"));
+ }, {value: "", keyMap: "emacs"});
+
testCM("save", function(cm) {
var saved = false;
CodeMirror.commands.save = function(cm) { saved = cm.getValue(); };
@@ -140,10 +155,4 @@
cm.triggerOnKeyDown(fakeEvent("Ctrl-S"));
is(saved, "hi");
}, {value: "hi", keyMap: "emacs"});
-
- testCM("gotoInvalidLineFloat", function(cm) {
- cm.openDialog = function(_, cb) { cb("2.2"); };
- cm.triggerOnKeyDown(fakeEvent("Alt-G"));
- cm.triggerOnKeyDown(fakeEvent("G"));
- }, {value: "1\n2\n3\n4", keyMap: "emacs"});
})();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/test/lint.js b/Mod manager/utils/QNModManager/CodeMirror/test/lint.js
index bdbed1a8..561f1462 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/test/lint.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/test/lint.js
@@ -3,7 +3,7 @@ var blint = require("blint");
["mode", "lib", "addon", "keymap"].forEach(function(dir) {
blint.checkDir(dir, {
browser: true,
- allowedGlobals: ["CodeMirror", "define", "test", "requirejs", "globalThis"],
+ allowedGlobals: ["CodeMirror", "define", "test", "requirejs", "globalThis", "WeakSet"],
ecmaVersion: 5,
tabs: dir == "lib"
});
@@ -12,6 +12,7 @@ var blint = require("blint");
["src"].forEach(function(dir) {
blint.checkDir(dir, {
browser: true,
+ allowedGlobals: ["WeakSet"],
ecmaVersion: 6,
semicolons: false
});
diff --git a/Mod manager/utils/QNModManager/CodeMirror/test/test.js b/Mod manager/utils/QNModManager/CodeMirror/test/test.js
index 2a5101f4..357c2b9e 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/test/test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/test/test.js
@@ -1807,8 +1807,8 @@ testCM("atomicMarker", function(cm) {
inclusiveRight: ri
};
- if (ls === true || ls === false) options["selectLeft"] = ls;
- if (rs === true || rs === false) options["selectRight"] = rs;
+ if (ls === true || ls === false) options.selectLeft = ls;
+ if (rs === true || rs === false) options.selectRight = rs;
return cm.markText(Pos(ll, cl), Pos(lr, cr), options);
}
@@ -2672,3 +2672,7 @@ testCM("mode_lookahead", function(cm) {
eq(cm.getTokenAt(Pos(0, 1)).type, null)
eq(cm.getTokenAt(Pos(1, 1)).type, "atom")
}, {value: "foo\na\nx\nx\n", mode: "lookahead_mode"})
+
+testCM("should have translate=no attribute", function(cm) {
+ eq(cm.getWrapperElement().getAttribute("translate"), "no")
+}, {})
diff --git a/Mod manager/utils/QNModManager/CodeMirror/test/vim_test.js b/Mod manager/utils/QNModManager/CodeMirror/test/vim_test.js
index 57d276e8..0085633d 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/test/vim_test.js
+++ b/Mod manager/utils/QNModManager/CodeMirror/test/vim_test.js
@@ -19,7 +19,7 @@ var code = '' +
'}\n';
var lines = (function() {
- lineText = code.split('\n');
+ var lineText = code.split('\n');
var ret = [];
for (var i = 0; i < lineText.length; i++) {
ret[i] = {
@@ -124,6 +124,12 @@ function expectFail(fn) {
throw new Error("Expected to throw an error");
}
+function vimKeyToKeyName(key) {
+ return key.replace(/[CS]-|CR|BS/g, function(part) {
+ return {"C-": "Ctrl-", "S-": "Shift", CR: "Return", BS: "Backspace"}[part];
+ });
+}
+
function testVim(name, run, opts, expectedFail) {
var vimOpts = {
lineNumbers: true,
@@ -138,51 +144,35 @@ function testVim(name, run, opts, expectedFail) {
}
return test('vim_' + name, function() {
var place = document.getElementById("testground");
+ place.style.visibility = "visible";
var cm = CodeMirror(place, vimOpts);
var vim = CodeMirror.Vim.maybeInitVimState_(cm);
- function doKeysFn(cm) {
- return function(args) {
- if (args instanceof Array) {
- arguments = args;
- }
- for (var i = 0; i < arguments.length; i++) {
- var result = CodeMirror.Vim.handleKey(cm, arguments[i]);
- if (!result && cm.state.vim.insertMode) {
- cm.replaceSelections(fillArray(arguments[i], cm.listSelections().length));
- }
- }
- }
- }
- function doInsertModeKeysFn(cm) {
- return function(args) {
- if (args instanceof Array) { arguments = args; }
- function executeHandler(handler) {
- if (typeof handler == 'string') {
- CodeMirror.commands[handler](cm);
- } else {
- handler(cm);
- }
- return true;
+ cm.focus();
+ // workaround for cm5 slow polling in blurred window
+ Object.defineProperty(cm.state, "focused", {
+ set: function(e) {},
+ get: function() {
+ return document.activeElement == cm.getInputField();
}
- for (var i = 0; i < arguments.length; i++) {
- var key = arguments[i];
- // Find key in keymap and handle.
- var handled = CodeMirror.lookupKey(key, cm.getOption('keyMap'), executeHandler, cm);
- // Record for insert mode.
- if (handled == "handled" && cm.state.vim.insertMode && arguments[i] != 'Esc') {
- var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges;
- if (lastChange && (key.indexOf('Delete') != -1 || key.indexOf('Backspace') != -1)) {
- lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key));
- }
+ });
+
+ function doKeysFn(cm) {
+ return function() {
+ var args = arguments[0]
+ if (!Array.isArray(args)) { args = arguments; }
+ for (var i = 0; i < args.length; i++) {
+ var key = args[i];
+ if (key.length > 1 && key[0] == "<" && key.slice(-1) == ">") {
+ key = vimKeyToKeyName(key.slice(1, -1));
}
+ typeKey(key);
}
}
}
function doExFn(cm) {
return function(command) {
- cm.openDialog = helpers.fakeOpenDialog(command);
- helpers.doKeys(':');
+ helpers.doKeys(':', command, '\n');
}
}
function assertCursorAtFn(cm) {
@@ -196,44 +186,25 @@ function testVim(name, run, opts, expectedFail) {
eqCursorPos(cm.getCursor(), pos);
}
}
- function fakeOpenDialog(result) {
- return function(text, callback) {
- return callback(result);
- }
- }
- function fakeOpenNotification(matcher) {
- return function(text) {
- matcher(text);
- }
- }
var helpers = {
doKeys: doKeysFn(cm),
- // Warning: Only emulates keymap events, not character insertions. Use
- // replaceRange to simulate character insertions.
- // Keys are in CodeMirror format, NOT vim format.
- doInsertModeKeys: doInsertModeKeysFn(cm),
doEx: doExFn(cm),
assertCursorAt: assertCursorAtFn(cm),
- fakeOpenDialog: fakeOpenDialog,
- fakeOpenNotification: fakeOpenNotification,
getRegisterController: function() {
return CodeMirror.Vim.getRegisterController();
+ },
+ getNotificationText: function() {
+ return cm.getWrapperElement().querySelector(".cm-vim-message").textContent;
}
}
CodeMirror.Vim.resetVimGlobalState_();
var successful = false;
- var savedOpenNotification = cm.openNotification;
- var savedOpenDialog = cm.openDialog;
try {
run(cm, vim, helpers);
successful = true;
} finally {
- cm.openNotification = savedOpenNotification;
- cm.openDialog = savedOpenDialog;
- if (!successful || verbose) {
- place.style.visibility = "visible";
- } else {
- place.removeChild(cm.getWrapperElement());
+ if (successful && !verbose) {
+ cm.getWrapperElement().remove();
}
}
}, expectedFail);
@@ -264,12 +235,11 @@ var jumplistScene = ''+
'}word\n'+
'word\n'+
'word\n';
-function testJumplist(name, keys, endPos, startPos, dialog) {
+function testJumplist(name, keys, endPos, startPos) {
endPos = makeCursor(endPos[0], endPos[1]);
startPos = makeCursor(startPos[0], startPos[1]);
testVim(name, function(cm, vim, helpers) {
CodeMirror.Vim.resetVimGlobalState_();
- if(dialog)cm.openDialog = helpers.fakeOpenDialog('word');
cm.setCursor(startPos);
helpers.doKeys.apply(null, keys);
helpers.assertCursorAt(endPos);
@@ -294,8 +264,8 @@ testJumplist('jumplist_N', ['#', 'N', ''], [1,1], [2,3]);
testJumplist('jumplist_repeat_', ['*', '*', '*', '3', ''], [2,3], [2,3]);
testJumplist('jumplist_repeat_', ['*', '*', '*', '3', '', '2', ''], [5,0], [2,3]);
testJumplist('jumplist_repeated_motion', ['3', '*', ''], [2,3], [2,3]);
-testJumplist('jumplist_/', ['/', ''], [2,3], [2,3], 'dialog');
-testJumplist('jumplist_?', ['?', ''], [2,3], [2,3], 'dialog');
+testJumplist('jumplist_/', ['/', 'dialog\n', ''], [2,3], [2,3]);
+testJumplist('jumplist_?', ['?', 'dialog\n', ''], [2,3], [2,3]);
testJumplist('jumplist_skip_deleted_mark',
['*', 'n', 'n', 'k', 'd', 'k', '', '', ''],
[0,2], [0,2]);
@@ -495,7 +465,7 @@ testVim('j_k_and_gj_gk', function(cm,vim,helpers){
//should return to the same character-index
helpers.doKeys('k');
helpers.assertCursorAt(0, 176);
-},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'});
+},{ lineWrapping:true, value: 'This line is intentionally long. It tests movements of gj and gk over wrapped lines. Starts on the end of this line, then makes a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'});
testVim('gj_gk', function(cm, vim, helpers) {
cm.setSize(120);
// Test top of document edge case.
@@ -518,11 +488,35 @@ testVim('gj_gk', function(cm, vim, helpers) {
// Test bottom of document edge case.
helpers.doKeys('100', 'g', 'j');
var endingPos = cm.getCursor();
- is(endingPos != 0, 'gj should not be on wrapped line 0');
+ is(endingPos.ch != 0, 'gj should not be on wrapped line 0');
var topLeftCharCoords = cm.charCoords(makeCursor(0, 0));
var endingCharCoords = cm.charCoords(endingPos);
is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0');
},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentionallylongtotestmovementofgjandgkoverwrappedlines.' });
+testVim('g0_g$', function(cm, vim, helpers) {
+ var topLeftCharCoords = cm.charCoords(makeCursor(0, 0));
+ cm.setCursor(0, 4);
+ cm.setSize(120);
+ helpers.doKeys('g', 'Down');
+ var secondLineCoords = cm.charCoords(cm.getCursor());
+ is(secondLineCoords.top > topLeftCharCoords.top);
+ is(secondLineCoords.left > topLeftCharCoords.left);
+
+ helpers.doKeys('g', '0');
+ var start = cm.getCursor();
+ var startCoords = cm.charCoords(start);
+ is(start.ch != 0);
+ is(startCoords.left == topLeftCharCoords.left);
+ is(secondLineCoords.top === startCoords.top);
+ is(secondLineCoords.left > startCoords.left);
+
+ helpers.doKeys('g', '$');
+ var end = cm.getCursor();
+ var endCoords = cm.charCoords(end);
+ is(startCoords.left < endCoords.left);
+ is(startCoords.top == endCoords.top);
+ is(start.ch < end.ch && end.ch < cm.getValue().length / 2);
+},{ lineNumbers: false, lineWrapping:true, value: 'This line is intentionally long to test movement of g$ and g0 over wrapped lines.' });
testVim('}', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('}');
@@ -601,14 +595,14 @@ testVim('paragraph_motions', function(cm, vim, helpers) {
// ip inside empty space
cm.setCursor(10, 0);
helpers.doKeys('v', 'i', 'p');
- eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(12, 0), cm.getCursor('head'));
+ eqCursorPos(new Pos(7, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(12, 0), cm.getCursor('head'));
helpers.doKeys('i', 'p');
- eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(13, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(7, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(13, 1), cm.getCursor('head'));
helpers.doKeys('2', 'i', 'p');
- eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(16, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(7, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(16, 1), cm.getCursor('head'));
// should switch to visualLine mode
cm.setCursor(14, 0);
@@ -617,31 +611,31 @@ testVim('paragraph_motions', function(cm, vim, helpers) {
cm.setCursor(14, 0);
helpers.doKeys('', 'V', 'i', 'p');
- eqCursorPos(Pos(16, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(16, 1), cm.getCursor('head'));
// ap inside empty space
cm.setCursor(10, 0);
helpers.doKeys('', 'v', 'a', 'p');
- eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(13, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(7, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(13, 1), cm.getCursor('head'));
helpers.doKeys('a', 'p');
- eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(16, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(7, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(16, 1), cm.getCursor('head'));
cm.setCursor(13, 0);
helpers.doKeys('v', 'a', 'p');
- eqCursorPos(Pos(13, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(14, 0), cm.getCursor('head'));
+ eqCursorPos(new Pos(13, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(14, 0), cm.getCursor('head'));
cm.setCursor(16, 0);
helpers.doKeys('v', 'a', 'p');
- eqCursorPos(Pos(14, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(16, 1), cm.getCursor('head'));
+ eqCursorPos(new Pos(14, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(16, 1), cm.getCursor('head'));
cm.setCursor(0, 0);
helpers.doKeys('v', 'a', 'p');
- eqCursorPos(Pos(0, 0), cm.getCursor('anchor'));
- eqCursorPos(Pos(4, 0), cm.getCursor('head'));
+ eqCursorPos(new Pos(0, 0), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(4, 0), cm.getCursor('head'));
cm.setCursor(0, 0);
helpers.doKeys('d', 'i', 'p');
@@ -998,6 +992,12 @@ testVim('dd_only_line', function(cm, vim, helpers) {
var register = helpers.getRegisterController().getRegister();
eq(expectedRegister, register.toString());
}, { value: "thisistheonlyline" });
+testVim('cG', function(cm, vim, helpers) {
+ cm.setCursor(0, 0);
+ helpers.doKeys('c', 'G', 'inserted');
+ eq('inserted\n', cm.getValue());
+ helpers.assertCursorAt(0, 8);
+}, { value: 'line1\nline2'});
// Yank commands should behave the exact same as d commands, expect that nothing
// gets deleted.
testVim('yw_repeat', function(cm, vim, helpers) {
@@ -1130,6 +1130,23 @@ testVim('I_visual_block_replay', function(cm, vim, helpers) {
eq('12+-34\n5+-6+-78\na+-b+-cdefg\nx+-yz', cm.getValue());
}, {value: '1234\n5678\nabcdefg\nxyz'});
+testVim('visual_block_backwards', function(cm, vim, helpers) {
+ cm.setCursor(0, 0);
+ helpers.doKeys('3', 'l');
+ helpers.doKeys('', '2', 'j', '2', '');
+ eq('123\n678\nbcd', cm.getSelection());
+ helpers.doKeys('A');
+ helpers.assertCursorAt(0, 4);
+ helpers.doKeys('A', '');
+ helpers.assertCursorAt(0, 4);
+ helpers.doKeys('g', 'v');
+ eq('123\n678\nbcd', cm.getSelection());
+ helpers.doKeys('x');
+ helpers.assertCursorAt(0, 1);
+ helpers.doKeys('g', 'v');
+ eq('A4 \nA9 \nAef', cm.getSelection());
+}, {value: '01234 line 1\n56789 line 2\nabcdefg line 3\nline 4'});
+
testVim('d_visual_block', function(cm, vim, helpers) {
cm.setCursor(0, 1);
helpers.doKeys('', '2', 'j', 'l', 'l', 'l', 'd');
@@ -1185,7 +1202,7 @@ testVim('on_mode_change', function(cm, vim, helpers) {
test('', 'normal');
test('v', 'visual');
test(':', ''); // Event for Command-line mode not implemented.
- test('y', 'normal');
+ test('y\n', 'normal');
});
// Swapcase commands edit in place and do not modify registers.
@@ -1232,12 +1249,19 @@ testVim('gu_and_gU', function(cm, vim, helpers) {
eq(cm.getValue(), 'wa wb Xx wc wd');
eqCursorPos(makeCursor(0, 3), cm.getCursor());
- // TODO: support gUgU guu
- // eqCursorPos(makeCursor(0, 0), cm.getCursor());
-
var register = helpers.getRegisterController().getRegister();
eq('', register.toString());
is(!register.linewise);
+
+ cm.setCursor(curStart);
+ cm.setValue('abc efg\nxyz');
+ helpers.doKeys('g', 'U', 'g', 'U');
+ eq(cm.getValue(), 'ABC EFG\nxyz');
+ helpers.doKeys('g', 'u', 'u');
+ eq(cm.getValue(), 'abc efg\nxyz');
+ eqCursorPos(makeCursor(0, 0), cm.getCursor());
+ helpers.doKeys('g', 'U', '2', 'U');
+ eq(cm.getValue(), 'ABC EFG\nXYZ');
}, { value: 'wa wb xx wc wd' });
testVim('visual_block_~', function(cm, vim, helpers) {
cm.setCursor(1, 1);
@@ -1473,7 +1497,7 @@ testSelection('vi{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'vi{', '\n\tbar\n\t');
testSelection('va{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'va{', '{\n\tbar\n\t}');
testVim('mouse_select', function(cm, vim, helpers) {
- cm.setSelection(Pos(0, 2), Pos(0, 4), {origin: '*mouse'});
+ cm.setSelection(new Pos(0, 2), new Pos(0, 4), {origin: '*mouse'});
is(cm.state.vim.visualMode);
is(!cm.state.vim.visualLine);
is(!cm.state.vim.visualBlock);
@@ -1565,6 +1589,19 @@ testVim('/ search forward', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 11);
});
}, {value: '__jmp1 jmp2 jmp'});
+testVim('insert_ctrl_u', function(cm, vim, helpers) {
+ var curStart = makeCursor(0, 10);
+ cm.setCursor(curStart);
+ helpers.doKeys('a');
+ helpers.doKeys('');
+ eq('', cm.getValue());
+ var register = helpers.getRegisterController().getRegister();
+ eq('word1/word2', register.toString());
+ is(!register.linewise);
+ var curEnd = makeCursor(0, 0);
+ eqCursorPos(curEnd, cm.getCursor());
+ eq('vim-insert', cm.getOption('keyMap'));
+}, { value: 'word1/word2' });
testVim('insert_ctrl_w', function(cm, vim, helpers) {
var curStart = makeCursor(0, 10);
cm.setCursor(curStart);
@@ -1624,7 +1661,7 @@ testVim('i_repeat_delete', function(cm, vim, helpers) {
cm.setCursor(0, 4);
helpers.doKeys('2', 'i');
helpers.doKeys('z')
- helpers.doInsertModeKeys('Backspace', 'Backspace');
+ helpers.doKeys('Backspace', 'Backspace');
helpers.doKeys('');
eq('abe', cm.getValue());
helpers.assertCursorAt(0, 1);
@@ -1643,7 +1680,7 @@ testVim('insert', function(cm, vim, helpers) {
testVim('i_backspace', function(cm, vim, helpers) {
cm.setCursor(0, 10);
helpers.doKeys('i');
- helpers.doInsertModeKeys('Backspace');
+ helpers.doKeys('Backspace');
helpers.assertCursorAt(0, 9);
eq('012345678', cm.getValue());
}, { value: '0123456789'});
@@ -1651,20 +1688,20 @@ testVim('i_overwrite_backspace', function(cm, vim, helpers) {
cm.setCursor(0, 10);
helpers.doKeys('i');
helpers.doKeys('');
- helpers.doInsertModeKeys('Backspace');
- helpers.assertCursorAt(Pos(0, 9, "after"));
+ helpers.doKeys('Backspace');
+ helpers.assertCursorAt(new Pos(0, 9, "after"));
eq('0123456789', cm.getValue());
}, { value: '0123456789'});
testVim('i_forward_delete', function(cm, vim, helpers) {
cm.setCursor(0, 3);
helpers.doKeys('i');
- helpers.doInsertModeKeys('Delete');
+ helpers.doKeys('Delete');
helpers.assertCursorAt(0, 3);
eq('A124\nBCD', cm.getValue());
- helpers.doInsertModeKeys('Delete');
+ helpers.doKeys('Delete');
helpers.assertCursorAt(0, 3);
eq('A12\nBCD', cm.getValue());
- helpers.doInsertModeKeys('Delete');
+ helpers.doKeys('Delete');
helpers.assertCursorAt(0, 3);
eq('A12BCD', cm.getValue());
}, { value: 'A1234\nBCD'});
@@ -1916,8 +1953,7 @@ testVim('mark\'', function(cm, vim, helpers) {
helpers.doKeys('`', '`');
helpers.assertCursorAt(1, 3);
// motions that update jumplist
- cm.openDialog = helpers.fakeOpenDialog('=');
- helpers.doKeys('/');
+ helpers.doKeys('/', '=', '\n');
helpers.assertCursorAt(6, 20);
helpers.doKeys('`', '`');
helpers.assertCursorAt(1, 3);
@@ -2213,20 +2249,20 @@ testVim('visual_crossover_left', function(cm, vim, helpers) {
testVim('visual_crossover_up', function(cm, vim, helpers) {
cm.setCursor(3, 2);
helpers.doKeys('v', 'j', 'k', 'k');
- eqCursorPos(Pos(2, 2), cm.getCursor('head'));
- eqCursorPos(Pos(3, 3), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(2, 2), cm.getCursor('head'));
+ eqCursorPos(new Pos(3, 3), cm.getCursor('anchor'));
helpers.doKeys('k');
- eqCursorPos(Pos(1, 2), cm.getCursor('head'));
- eqCursorPos(Pos(3, 3), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(1, 2), cm.getCursor('head'));
+ eqCursorPos(new Pos(3, 3), cm.getCursor('anchor'));
}, { value: 'cross\ncross\ncross\ncross\ncross\n'});
testVim('visual_crossover_down', function(cm, vim, helpers) {
cm.setCursor(1, 2);
helpers.doKeys('v', 'k', 'j', 'j');
- eqCursorPos(Pos(2, 3), cm.getCursor('head'));
- eqCursorPos(Pos(1, 2), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(2, 3), cm.getCursor('head'));
+ eqCursorPos(new Pos(1, 2), cm.getCursor('anchor'));
helpers.doKeys('j');
- eqCursorPos(Pos(3, 3), cm.getCursor('head'));
- eqCursorPos(Pos(1, 2), cm.getCursor('anchor'));
+ eqCursorPos(new Pos(3, 3), cm.getCursor('head'));
+ eqCursorPos(new Pos(1, 2), cm.getCursor('anchor'));
}, { value: 'cross\ncross\ncross\ncross\ncross\n'});
testVim('visual_exit', function(cm, vim, helpers) {
helpers.doKeys('', 'l', 'j', 'j', '');
@@ -2381,14 +2417,14 @@ testVim('reselect_visual_block', function(cm, vim, helpers) {
helpers.doKeys('', 'k', 'h', '');
cm.setCursor(2, 1);
helpers.doKeys('v', 'l', 'g', 'v');
- eqCursorPos(Pos(1, 2), vim.sel.anchor);
- eqCursorPos(Pos(0, 1), vim.sel.head);
+ eqCursorPos(new Pos(1, 2), vim.sel.anchor);
+ eqCursorPos(new Pos(0, 1), vim.sel.head);
// Ensure selection is done with visual block mode rather than one
// continuous range.
eq(cm.getSelections().join(''), '23oo')
helpers.doKeys('g', 'v');
- eqCursorPos(Pos(2, 1), vim.sel.anchor);
- eqCursorPos(Pos(2, 2), vim.sel.head);
+ eqCursorPos(new Pos(2, 1), vim.sel.anchor);
+ eqCursorPos(new Pos(2, 2), vim.sel.head);
helpers.doKeys('');
// Ensure selection of deleted range
cm.setCursor(1, 1);
@@ -2423,14 +2459,14 @@ testVim('o_visual', function(cm, vim, helpers) {
testVim('o_visual_block', function(cm, vim, helpers) {
cm.setCursor(0, 1);
helpers.doKeys('','3','j','l','l', 'o');
- eqCursorPos(Pos(3, 3), vim.sel.anchor);
- eqCursorPos(Pos(0, 1), vim.sel.head);
+ eqCursorPos(new Pos(3, 3), vim.sel.anchor);
+ eqCursorPos(new Pos(0, 1), vim.sel.head);
helpers.doKeys('O');
- eqCursorPos(Pos(3, 1), vim.sel.anchor);
- eqCursorPos(Pos(0, 3), vim.sel.head);
+ eqCursorPos(new Pos(3, 1), vim.sel.anchor);
+ eqCursorPos(new Pos(0, 3), vim.sel.head);
helpers.doKeys('o');
- eqCursorPos(Pos(0, 3), vim.sel.anchor);
- eqCursorPos(Pos(3, 1), vim.sel.head);
+ eqCursorPos(new Pos(0, 3), vim.sel.anchor);
+ eqCursorPos(new Pos(3, 1), vim.sel.head);
}, { value: 'abcd\nefgh\nijkl\nmnop'});
testVim('changeCase_visual', function(cm, vim, helpers) {
cm.setCursor(0, 0);
@@ -2485,10 +2521,8 @@ testVim('v_paste_from_register', function(cm, vim, helpers) {
helpers.doKeys('"', 'a', 'y', 'w');
cm.setCursor(1, 0);
helpers.doKeys('v', 'p');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+register/.test(text));
- });
+ helpers.doEx('registers');
+ is(/a\s+register/.test(helpers.getNotificationText()));
}, { value: 'register contents\nare not erased'});
testVim('S_normal', function(cm, vim, helpers) {
cm.setCursor(0, 1);
@@ -2558,17 +2592,14 @@ testVim('S_visual', function(cm, vim, helpers) {
}, { value: 'aa\nbb\ncc'});
testVim('d_/', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('match');
- helpers.doKeys('2', 'd', '/');
+ helpers.doKeys('2', 'd', '/', 'match', '\n');
helpers.assertCursorAt(0, 0);
eq('match \n next', cm.getValue());
- cm.openDialog = helpers.fakeOpenDialog('2');
- helpers.doKeys('d', ':');
+ helpers.doKeys('d', ':', '2', '\n');
// TODO eq(' next', cm.getValue());
}, { value: 'text match match \n next' });
testVim('/ and n/N', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('match');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'match', '\n');
helpers.assertCursorAt(0, 11);
helpers.doKeys('n');
helpers.assertCursorAt(1, 6);
@@ -2576,33 +2607,110 @@ testVim('/ and n/N', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 11);
cm.setCursor(0, 0);
- helpers.doKeys('2', '/');
+ helpers.doKeys('2', '/', 'match', '\n');
helpers.assertCursorAt(1, 6);
}, { value: 'match nope match \n nope Match' });
+testVim('/ and gn selects the appropriate word', function(cm, vim, helpers) {
+ helpers.doKeys('/', 'match', '\n');
+ helpers.assertCursorAt(0, 11);
+
+ // gn should highlight the the current word while it is within a match.
+
+ // gn when cursor is in beginning of match
+ helpers.doKeys('gn', '');
+ helpers.assertCursorAt(0, 15);
+
+ // gn when cursor is at end of match
+ helpers.doKeys('gn', '');
+ helpers.doKeys('');
+ helpers.assertCursorAt(0, 15);
+
+ // consecutive gns should extend the selection
+ helpers.doKeys('gn');
+ helpers.assertCursorAt(0, 16);
+ helpers.doKeys('gn');
+ helpers.assertCursorAt(1, 11);
+
+ // we should have selected the second and third "match"
+ helpers.doKeys('d');
+ eq('match nope ', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
+testVim('/ and gN selects the appropriate word', function(cm, vim, helpers) {
+ helpers.doKeys('/', 'match', '\n');
+ helpers.assertCursorAt(0, 11);
+
+ // gN when cursor is at beginning of match
+ helpers.doKeys('gN', '');
+ helpers.assertCursorAt(0, 11);
+
+ // gN when cursor is at end of match
+ helpers.doKeys('e', 'gN', '');
+ helpers.assertCursorAt(0, 11);
+
+ // consecutive gNs should extend the selection
+ helpers.doKeys('gN');
+ helpers.assertCursorAt(0, 11);
+ helpers.doKeys('gN');
+ helpers.assertCursorAt(0, 0);
+
+ // we should have selected the first and second "match"
+ helpers.doKeys('d');
+ eq(' \n nope Match', cm.getValue());
+}, { value: 'match nope match \n nope Match' })
+testVim('/ and gn with an associated operator', function(cm, vim, helpers) {
+ helpers.doKeys('/', 'match', '\n');
+ helpers.assertCursorAt(0, 11);
+
+ helpers.doKeys('c', 'gn', 'changed', '');
+
+ // change the current match.
+ eq('match nope changed \n nope Match', cm.getValue());
+
+ // change the next match.
+ helpers.doKeys('.');
+ eq('match nope changed \n nope changed', cm.getValue());
+
+ // change the final match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope changed', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
+testVim('/ and gN with an associated operator', function(cm, vim, helpers) {
+ helpers.doKeys('/', 'match', '\n');
+ helpers.assertCursorAt(0, 11);
+
+ helpers.doKeys('c', 'gN', 'changed', '');
+
+ // change the current match.
+ eq('match nope changed \n nope Match', cm.getValue());
+
+ // change the next match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope Match', cm.getValue());
+
+ // change the final match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope changed', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
testVim('/_case', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('Match');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'Match', '\n');
helpers.assertCursorAt(1, 6);
}, { value: 'match nope match \n nope Match' });
testVim('/_2_pcre', function(cm, vim, helpers) {
CodeMirror.Vim.setOption('pcre', true);
- cm.openDialog = helpers.fakeOpenDialog('(word){2}');
- helpers.doKeys('/');
+ helpers.doKeys('/', '(word){2}', '\n');
helpers.assertCursorAt(1, 9);
helpers.doKeys('n');
helpers.assertCursorAt(2, 1);
}, { value: 'word\n another wordword\n wordwordword\n' });
testVim('/_2_nopcre', function(cm, vim, helpers) {
CodeMirror.Vim.setOption('pcre', false);
- cm.openDialog = helpers.fakeOpenDialog('\\(word\\)\\{2}');
- helpers.doKeys('/');
+ helpers.doKeys('/', '\\(word\\)\\{2}', '\n');
helpers.assertCursorAt(1, 9);
helpers.doKeys('n');
helpers.assertCursorAt(2, 1);
}, { value: 'word\n another wordword\n wordwordword\n' });
testVim('/_nongreedy', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('aa');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'aa', '\n');
helpers.assertCursorAt(0, 4);
helpers.doKeys('n');
helpers.assertCursorAt(1, 3);
@@ -2610,8 +2718,7 @@ testVim('/_nongreedy', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 0);
}, { value: 'aaa aa \n a aa'});
testVim('?_nongreedy', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('aa');
- helpers.doKeys('?');
+ helpers.doKeys('?', 'aa', '\n');
helpers.assertCursorAt(1, 3);
helpers.doKeys('n');
helpers.assertCursorAt(0, 4);
@@ -2619,8 +2726,7 @@ testVim('?_nongreedy', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 1);
}, { value: 'aaa aa \n a aa'});
testVim('/_greedy', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('a+');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'a+', '\n');
helpers.assertCursorAt(0, 4);
helpers.doKeys('n');
helpers.assertCursorAt(1, 1);
@@ -2630,8 +2736,7 @@ testVim('/_greedy', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 0);
}, { value: 'aaa aa \n a aa'});
testVim('?_greedy', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('a+');
- helpers.doKeys('?');
+ helpers.doKeys('?', 'a+', '\n');
helpers.assertCursorAt(1, 3);
helpers.doKeys('n');
helpers.assertCursorAt(1, 1);
@@ -2641,8 +2746,7 @@ testVim('?_greedy', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 0);
}, { value: 'aaa aa \n a aa'});
testVim('/_greedy_0_or_more', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('a*');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'a*', '\n');
helpers.assertCursorAt(0, 3);
helpers.doKeys('n');
helpers.assertCursorAt(0, 4);
@@ -2656,19 +2760,19 @@ testVim('/_greedy_0_or_more', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 0);
}, { value: 'aaa aa\n aa'});
testVim('?_greedy_0_or_more', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('a*');
- helpers.doKeys('?');
+ helpers.doKeys('?', 'a*', '\n');
helpers.assertCursorAt(1, 1);
helpers.doKeys('n');
+ helpers.assertCursorAt(1, 0);
+ helpers.doKeys('n');
helpers.assertCursorAt(0, 5);
helpers.doKeys('n');
- helpers.assertCursorAt(0, 3);
+ helpers.assertCursorAt(0, 4);
helpers.doKeys('n');
helpers.assertCursorAt(0, 0);
}, { value: 'aaa aa\n aa'});
testVim('? and n/N', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('match');
- helpers.doKeys('?');
+ helpers.doKeys('?', 'match', '\n');
helpers.assertCursorAt(1, 6);
helpers.doKeys('n');
helpers.assertCursorAt(0, 11);
@@ -2676,9 +2780,89 @@ testVim('? and n/N', function(cm, vim, helpers) {
helpers.assertCursorAt(1, 6);
cm.setCursor(0, 0);
- helpers.doKeys('2', '?');
+ helpers.doKeys('2', '?', 'match', '\n');
helpers.assertCursorAt(0, 11);
}, { value: 'match nope match \n nope Match' });
+testVim('? and gn selects the appropriate word', function(cm, vim, helpers) {
+ helpers.doKeys('?', 'match', '\n', 'n');
+ helpers.assertCursorAt(0, 11);
+
+ // gn should highlight the the current word while it is within a match.
+
+ // gn when cursor is in beginning of match
+ helpers.doKeys('gn', '');
+ helpers.assertCursorAt(0, 11);
+
+ // gn when cursor is at end of match
+ helpers.doKeys('e', 'gn', '');
+ helpers.assertCursorAt(0, 11);
+
+ // consecutive gns should extend the selection
+ helpers.doKeys('gn');
+ helpers.assertCursorAt(0, 11);
+ helpers.doKeys('gn');
+ helpers.assertCursorAt(0, 0);
+
+ // we should have selected the first and second "match"
+ helpers.doKeys('d');
+ eq(' \n nope Match', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
+testVim('? and gN selects the appropriate word', function(cm, vim, helpers) {
+ helpers.doKeys('?', 'match', '\n', 'n');
+ helpers.assertCursorAt(0, 11);
+
+ // gN when cursor is at beginning of match
+ helpers.doKeys('gN', '');
+ helpers.assertCursorAt(0, 15);
+
+ // gN when cursor is at end of match
+ helpers.doKeys('gN', '');
+ helpers.assertCursorAt(0, 15);
+
+ // consecutive gNs should extend the selection
+ helpers.doKeys('gN');
+ helpers.assertCursorAt(0, 16);
+ helpers.doKeys('gN');
+ helpers.assertCursorAt(1, 11);
+
+ // we should have selected the second and third "match"
+ helpers.doKeys('d');
+ eq('match nope ', cm.getValue());
+}, { value: 'match nope match \n nope Match' })
+testVim('? and gn with an associated operator', function(cm, vim, helpers) {
+ helpers.doKeys('?', 'match', '\n', 'n');
+ helpers.assertCursorAt(0, 11);
+
+ helpers.doKeys('c', 'gn', 'changed', '');
+
+ // change the current match.
+ eq('match nope changed \n nope Match', cm.getValue());
+
+ // change the next match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope Match', cm.getValue());
+
+ // change the final match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope changed', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
+testVim('? and gN with an associated operator', function(cm, vim, helpers) {
+ helpers.doKeys('?', 'match', '\n', 'n');
+ helpers.assertCursorAt(0, 11);
+
+ helpers.doKeys('c', 'gN', 'changed', '');
+
+ // change the current match.
+ eq('match nope changed \n nope Match', cm.getValue());
+
+ // change the next match.
+ helpers.doKeys('.');
+ eq('match nope changed \n nope changed', cm.getValue());
+
+ // change the final match.
+ helpers.doKeys('.');
+ eq('changed nope changed \n nope changed', cm.getValue());
+}, { value: 'match nope match \n nope Match' });
testVim('*', function(cm, vim, helpers) {
cm.setCursor(0, 9);
helpers.doKeys('*');
@@ -2793,8 +2977,7 @@ testVim('macro_f_search', function(cm, vim, helpers) {
testVim('macro_slash_search', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('q', 'c');
- cm.openDialog = helpers.fakeOpenDialog('e');
- helpers.doKeys('/', 'q');
+ helpers.doKeys('/', 'e', '\n', 'q');
helpers.assertCursorAt(0, 2);
helpers.doKeys('@', 'c');
helpers.assertCursorAt(0, 7);
@@ -2804,10 +2987,8 @@ testVim('macro_slash_search', function(cm, vim, helpers) {
testVim('macro_multislash_search', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('q', 'd');
- cm.openDialog = helpers.fakeOpenDialog('e');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('t');
- helpers.doKeys('/', 'q');
+ helpers.doKeys('/', 'e', '\n');
+ helpers.doKeys('/', 't', '\n', 'q');
helpers.assertCursorAt(0, 12);
helpers.doKeys('@', 'd');
helpers.assertCursorAt(0, 15);
@@ -2887,64 +3068,62 @@ testVim('yank_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('"', 'a', 'y', 'y');
helpers.doKeys('j', '"', 'b', 'y', 'y');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+foo/.test(text));
- is(/b\s+bar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+foo/.test(text));
+ is(/b\s+bar/.test(text));
}, { value: 'foo\nbar'});
testVim('yank_visual_block', function(cm, vim, helpers) {
cm.setCursor(0, 1);
helpers.doKeys('', 'l', 'j', '"', 'a', 'y');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+oo\nar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ is(/a\s+oo\nar/.test(helpers.getNotificationText()));
}, { value: 'foo\nbar'});
testVim('yank_append_line_to_line_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('"', 'a', 'y', 'y');
helpers.doKeys('j', '"', 'A', 'y', 'y');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+foo\nbar/.test(text));
- is(/"\s+foo\nbar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+foo\nbar/.test(text));
+ is(/"\s+foo\nbar/.test(text));
}, { value: 'foo\nbar'});
testVim('yank_append_word_to_word_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('"', 'a', 'y', 'w');
helpers.doKeys('j', '"', 'A', 'y', 'w');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+foobar/.test(text));
- is(/"\s+foobar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+foobar/.test(text));
+ is(/"\s+foobar/.test(text));
}, { value: 'foo\nbar'});
testVim('yank_append_line_to_word_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('"', 'a', 'y', 'w');
helpers.doKeys('j', '"', 'A', 'y', 'y');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+foo\nbar/.test(text));
- is(/"\s+foo\nbar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+foo\nbar/.test(text));
+ is(/"\s+foo\nbar/.test(text));
}, { value: 'foo\nbar'});
testVim('yank_append_word_to_line_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doKeys('"', 'a', 'y', 'y');
helpers.doKeys('j', '"', 'A', 'y', 'w');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+foo\nbar/.test(text));
- is(/"\s+foo\nbar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+foo\nbar/.test(text));
+ is(/"\s+foo\nbar/.test(text));
+}, { value: 'foo\nbar'});
+testVim('black_hole_register', function(cm,vim,helpers) {
+ helpers.doKeys('g', 'g', 'y', 'G');
+ helpers.doEx('registers');
+ var registersText = helpers.getNotificationText();
+ helpers.doKeys('"', '_', 'd', 'G');
+ helpers.doEx('registers');
+ eq(registersText, helpers.getNotificationText(), 'One or more registers were modified');
+ helpers.doKeys('"', '_', 'p');
+ eq('', cm.getValue());
}, { value: 'foo\nbar'});
testVim('macro_register', function(cm, vim, helpers) {
cm.setCursor(0, 0);
@@ -2956,190 +3135,92 @@ testVim('macro_register', function(cm, vim, helpers) {
helpers.doKeys('style')
helpers.doKeys('');
helpers.doKeys('q');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/a\s+i/.test(text));
- is(/b\s+o/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/a\s+i/.test(text));
+ is(/b\s+o/.test(text));
}, { value: ''});
testVim('._register', function(cm,vim,helpers) {
cm.setCursor(0,0);
helpers.doKeys('i');
helpers.doKeys('foo')
helpers.doKeys('');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/\.\s+foo/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ is(/\.\s+foo/.test(helpers.getNotificationText()));
}, {value: ''});
testVim(':_register', function(cm,vim,helpers) {
helpers.doEx('bar');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/:\s+bar/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doEx('registers');
+ is(/:\s+bar/.test(helpers.getNotificationText()));
}, {value: ''});
+testVim('registers_html_encoding', function(cm,vim,helpers) {
+ helpers.doKeys('y', 'y');
+ helpers.doEx('registers');
+ is(/"\s+'});
testVim('search_register_escape', function(cm, vim, helpers) {
// Check that the register is restored if the user escapes rather than confirms.
- cm.openDialog = helpers.fakeOpenDialog('waldo');
- helpers.doKeys('/');
- var onKeyDown;
- var onKeyUp;
- var KEYCODES = {
- f: 70,
- o: 79,
- Esc: 27
- };
- cm.openDialog = function(template, callback, options) {
- onKeyDown = options.onKeyDown;
- onKeyUp = options.onKeyUp;
- };
- var close = function() {};
- helpers.doKeys('/');
- // Fake some keyboard events coming in.
- onKeyDown({keyCode: KEYCODES.f}, '', close);
- onKeyUp({keyCode: KEYCODES.f}, '', close);
- onKeyDown({keyCode: KEYCODES.o}, 'f', close);
- onKeyUp({keyCode: KEYCODES.o}, 'f', close);
- onKeyDown({keyCode: KEYCODES.o}, 'fo', close);
- onKeyUp({keyCode: KEYCODES.o}, 'fo', close);
- onKeyDown({keyCode: KEYCODES.Esc}, 'foo', close);
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/waldo/.test(text));
- is(!/foo/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doKeys('/', 'waldo', '\n');
+ helpers.doKeys('/', 'foo', '');
+ helpers.doEx('registers');
+ var text = helpers.getNotificationText();
+ is(/waldo/.test(text));
+ is(!/foo/.test(text));
}, {value: ''});
testVim('search_register', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('foo');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('registers');
- cm.openNotification = helpers.fakeOpenNotification(function(text) {
- is(/\/\s+foo/.test(text));
- });
- helpers.doKeys(':');
+ helpers.doKeys('/', 'foo', '\n');
+ helpers.doEx('registers');
+ is(/\/\s+foo/.test(helpers.getNotificationText()));
}, {value: ''});
testVim('search_history', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('this');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('checks');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('search');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('history');
- helpers.doKeys('/');
- cm.openDialog = helpers.fakeOpenDialog('checks');
- helpers.doKeys('/');
- var onKeyDown;
- var onKeyUp;
- var query = '';
- var keyCodes = {
- Up: 38,
- Down: 40
- };
- cm.openDialog = function(template, callback, options) {
- onKeyUp = options.onKeyUp;
- onKeyDown = options.onKeyDown;
- };
- var close = function(newVal) {
- if (typeof newVal == 'string') query = newVal;
- }
+ helpers.doKeys('/', 'this', '\n');
+ helpers.doKeys('/', 'checks', '\n');
+ helpers.doKeys('/', 'search', '\n');
+ helpers.doKeys('/', 'history', '\n');
+ helpers.doKeys('/', 'checks', '\n');
helpers.doKeys('/');
- onKeyDown({keyCode: keyCodes.Up}, query, close);
- onKeyUp({keyCode: keyCodes.Up}, query, close);
- eq(query, 'checks');
- onKeyDown({keyCode: keyCodes.Up}, query, close);
- onKeyUp({keyCode: keyCodes.Up}, query, close);
- eq(query, 'history');
- onKeyDown({keyCode: keyCodes.Up}, query, close);
- onKeyUp({keyCode: keyCodes.Up}, query, close);
- eq(query, 'search');
- onKeyDown({keyCode: keyCodes.Up}, query, close);
- onKeyUp({keyCode: keyCodes.Up}, query, close);
- eq(query, 'this');
- onKeyDown({keyCode: keyCodes.Down}, query, close);
- onKeyUp({keyCode: keyCodes.Down}, query, close);
- eq(query, 'search');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'checks');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'history');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'search');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'this');
+ helpers.doKeys('Down');
+ eq(document.activeElement.value, 'search');
}, {value: ''});
testVim('exCommand_history', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('registers');
- helpers.doKeys(':');
- cm.openDialog = helpers.fakeOpenDialog('sort');
- helpers.doKeys(':');
- cm.openDialog = helpers.fakeOpenDialog('map');
- helpers.doKeys(':');
- cm.openDialog = helpers.fakeOpenDialog('invalid');
- helpers.doKeys(':');
- var onKeyDown;
- var onKeyUp;
- var input = '';
- var keyCodes = {
- Up: 38,
- Down: 40,
- s: 115
- };
- cm.openDialog = function(template, callback, options) {
- onKeyUp = options.onKeyUp;
- onKeyDown = options.onKeyDown;
- };
- var close = function(newVal) {
- if (typeof newVal == 'string') input = newVal;
- }
+ helpers.doEx('registers');
+ helpers.doEx('sort');
+ helpers.doEx('map');
+ helpers.doEx('invalid');
helpers.doKeys(':');
- onKeyDown({keyCode: keyCodes.Up}, input, close);
- eq(input, 'invalid');
- onKeyDown({keyCode: keyCodes.Up}, input, close);
- eq(input, 'map');
- onKeyDown({keyCode: keyCodes.Up}, input, close);
- eq(input, 'sort');
- onKeyDown({keyCode: keyCodes.Up}, input, close);
- eq(input, 'registers');
- onKeyDown({keyCode: keyCodes.s}, '', close);
- input = 's';
- onKeyDown({keyCode: keyCodes.Up}, input, close);
- eq(input, 'sort');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'invalid');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'map');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'sort');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'registers');
+ helpers.doKeys('', ':');
+ helpers.doKeys('s');
+ eq(document.activeElement.value, 's');
+ helpers.doKeys('Up');
+ eq(document.activeElement.value, 'sort');
}, {value: ''});
testVim('search_clear', function(cm, vim, helpers) {
- var onKeyDown;
- var input = '';
- var keyCodes = {
- Ctrl: 17,
- u: 85
- };
- cm.openDialog = function(template, callback, options) {
- onKeyDown = options.onKeyDown;
- };
- var close = function(newVal) {
- if (typeof newVal == 'string') input = newVal;
- }
- helpers.doKeys('/');
- input = 'foo';
- onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
- onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
- eq(input, '');
+ helpers.doKeys('/', 'foo');
+ eq(document.activeElement.value, 'foo');
+ helpers.doKeys('');
+ eq(document.activeElement.value, '');
});
testVim('exCommand_clear', function(cm, vim, helpers) {
- var onKeyDown;
- var input = '';
- var keyCodes = {
- Ctrl: 17,
- u: 85
- };
- cm.openDialog = function(template, callback, options) {
- onKeyDown = options.onKeyDown;
- };
- var close = function(newVal) {
- if (typeof newVal == 'string') input = newVal;
- }
- helpers.doKeys(':');
- input = 'foo';
- onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
- onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
- eq(input, '');
+ helpers.doKeys(':', 'foo');
+ eq(document.activeElement.value, 'foo');
+ helpers.doKeys('');
+ eq(document.activeElement.value, '');
});
testVim('.', function(cm, vim, helpers) {
cm.setCursor(0, 0);
@@ -3162,8 +3243,8 @@ testVim('._insert', function(cm, vim, helpers) {
helpers.assertCursorAt(0, 6);
helpers.doKeys('O');
helpers.doKeys('xyz')
- helpers.doInsertModeKeys('Backspace');
- helpers.doInsertModeKeys('Down');
+ helpers.doKeys('Backspace');
+ helpers.doKeys('Down');
helpers.doKeys('');
helpers.doKeys('.');
eq('xy\nxy\ntestestt', cm.getValue());
@@ -3239,7 +3320,7 @@ testVim('._insert_cw_repeat', function(cm, vim, helpers) {
testVim('._delete', function(cm, vim, helpers) {
cm.setCursor(0, 5);
helpers.doKeys('i');
- helpers.doInsertModeKeys('Backspace');
+ helpers.doKeys('Backspace');
helpers.doKeys('');
helpers.doKeys('.');
eq('zace', cm.getValue());
@@ -3248,7 +3329,7 @@ testVim('._delete', function(cm, vim, helpers) {
testVim('._delete_repeat', function(cm, vim, helpers) {
cm.setCursor(0, 6);
helpers.doKeys('i');
- helpers.doInsertModeKeys('Backspace');
+ helpers.doKeys('Backspace');
helpers.doKeys('');
helpers.doKeys('2', '.');
eq('zzce', cm.getValue());
@@ -3465,6 +3546,7 @@ testVim('Ty,;', function(cm, vim, helpers) {
eq('01230123456789', cm.getValue());
}, { value: '0123456789'});
testVim('HML', function(cm, vim, helpers) {
+ cm.refresh();
var lines = 35;
var textHeight = cm.defaultTextHeight();
cm.setSize(600, lines*textHeight);
@@ -3489,6 +3571,7 @@ forEach(['zb','zz','zt','z-','z.','z'], function(e, idx){
var lineNum = 250;
var lines = 35;
testVim(e, function(cm, vim, helpers) {
+ cm.refresh();
var k1 = e[0];
var k2 = e.substring(1);
var textHeight = cm.defaultTextHeight();
@@ -3501,21 +3584,23 @@ forEach(['zb','zz','zt','z-','z.','z'], function(e, idx){
})()});
});
testVim('zb_to_bottom', function(cm, vim, helpers){
+ cm.refresh();
var lineNum = 250;
cm.setSize(600, 35*cm.defaultTextHeight());
cm.setCursor(lineNum, 0);
helpers.doKeys('z', 'b');
var scrollInfo = cm.getScrollInfo();
- eq(scrollInfo.top + scrollInfo.clientHeight, cm.charCoords(Pos(lineNum, 0), 'local').bottom);
+ eq(scrollInfo.top + scrollInfo.clientHeight, cm.charCoords(new Pos(lineNum, 0), 'local').bottom);
}, { value: (function(){
return new Array(500).join('\n');
})()});
testVim('zt_to_top', function(cm, vim, helpers){
+ cm.refresh();
var lineNum = 250;
cm.setSize(600, 35*cm.defaultTextHeight());
cm.setCursor(lineNum, 0);
helpers.doKeys('z', 't');
- eq(cm.getScrollInfo().top, cm.charCoords(Pos(lineNum, 0), 'local').top);
+ eq(cm.getScrollInfo().top, cm.charCoords(new Pos(lineNum, 0), 'local').top);
}, { value: (function(){
return new Array(500).join('\n');
})()});
@@ -3540,8 +3625,7 @@ var moveTillCharacterSandbox =
testVim('moveTillCharacter', function(cm, vim, helpers){
cm.setCursor(0, 0);
// Search for the 'q'.
- cm.openDialog = helpers.fakeOpenDialog('q');
- helpers.doKeys('/');
+ helpers.doKeys('/', 'q', '\n');
eq(4, cm.getCursor().ch);
// Jump to just before the first o in the list.
helpers.doKeys('t');
@@ -3576,8 +3660,7 @@ testVim('searchForPipe', function(cm, vim, helpers){
CodeMirror.Vim.setOption('pcre', false);
cm.setCursor(0, 0);
// Search for the '|'.
- cm.openDialog = helpers.fakeOpenDialog('|');
- helpers.doKeys('/');
+ helpers.doKeys('/', '|', '\n');
eq(4, cm.getCursor().ch);
}, { value: 'this|that'});
@@ -3877,37 +3960,37 @@ testVim('ex_sort_pattern_alpha_num', function(cm, vim, helpers) {
testVim('ex_global', function(cm, vim, helpers) {
cm.setCursor(0, 0);
helpers.doEx('g/one/s//two');
- eq('two two\n two two\n two two', cm.getValue());
+ eq('two one\n two one\n two one', cm.getValue());
helpers.doEx('1,2g/two/s//one');
- eq('one one\n one one\n two two', cm.getValue());
+ eq('one one\n one one\n two one', cm.getValue());
+ helpers.doEx('g/^ /');
+ eq(' one one\n two one', helpers.getNotificationText());
}, {value: 'one one\n one one\n one one'});
+testVim('ex_global_substitute_join', function(cm, vim, helpers) {
+ helpers.doEx('g/o/s/\\n/;');
+ eq('one;two\nthree\nfour;five\n', cm.getValue());
+}, {value: 'one\ntwo\nthree\nfour\nfive\n'});
+testVim('ex_global_substitute_split', function(cm, vim, helpers) {
+ helpers.doEx('g/e/s/[or]/\\n');
+ eq('\nne\ntwo\nth\nee\nfour\nfive\n', cm.getValue());
+}, {value: 'one\ntwo\nthree\nfour\nfive\n'});
testVim('ex_global_confirm', function(cm, vim, helpers) {
cm.setCursor(0, 0);
- var onKeyDown;
- var openDialogSave = cm.openDialog;
- var KEYCODES = {
- a: 65,
- n: 78,
- q: 81,
- y: 89
- };
- // Intercept the ex command, 'global'
- cm.openDialog = function(template, callback, options) {
- // Intercept the prompt for the embedded ex command, 'substitute'
- cm.openDialog = function(template, callback, options) {
- onKeyDown = options.onKeyDown;
- };
- callback('g/one/s//two/gc');
- };
- helpers.doKeys(':');
- var close = function() {};
- onKeyDown({keyCode: KEYCODES.n}, '', close);
- onKeyDown({keyCode: KEYCODES.y}, '', close);
- onKeyDown({keyCode: KEYCODES.a}, '', close);
- onKeyDown({keyCode: KEYCODES.q}, '', close);
- onKeyDown({keyCode: KEYCODES.y}, '', close);
+ helpers.doEx('g/one/s//two/gc');
+ helpers.doKeys('n');
+ helpers.doKeys('y');
+ helpers.doKeys('a');
+ helpers.doKeys('q');
+ helpers.doKeys('y');
eq('one two\n two two\n one one\n two one\n one one', cm.getValue());
}, {value: 'one one\n one one\n one one\n one one\n one one'});
+// test for :vglobal command
+testVim('ex_vglobal', function(cm, vim, helpers) {
+ helpers.doEx('v/e/s/o/e');
+ eq('one\n twe\n three\n feur\n five\n', cm.getValue());
+ helpers.doEx('v/[vw]');
+ eq('one\n three\n feur\n', helpers.getNotificationText());
+}, {value: 'one\n two\n three\n four\n five\n'});
// Basic substitute tests.
testVim('ex_substitute_same_line', function(cm, vim, helpers) {
cm.setCursor(1, 0);
@@ -3977,14 +4060,15 @@ testVim('ex_substitute_visual_range', function(cm, vim, helpers) {
cm.setCursor(1, 0);
// Set last visual mode selection marks '< and '> at lines 2 and 4
helpers.doKeys('V', '2', 'j', 'v');
- helpers.doEx('\'<,\'>s/\\d/0/g');
+ helpers.doKeys(':');
+ eq(document.activeElement.value, "'<,'>");
+ helpers.doKeys('s/\\d/0/g', '\n');
eq('1\n0\n0\n0\n5', cm.getValue());
}, { value: '1\n2\n3\n4\n5' });
testVim('ex_substitute_empty_query', function(cm, vim, helpers) {
// If the query is empty, use last query.
cm.setCursor(1, 0);
- cm.openDialog = helpers.fakeOpenDialog('1');
- helpers.doKeys('/');
+ helpers.doKeys('/', '1\n');
helpers.doEx('s//b/g');
eq('abb ab2 ab3', cm.getValue());
}, { value: 'a11 a12 a13' });
@@ -4106,18 +4190,42 @@ testSubstitute('ex_substitute_multibackslash_replacement', {
value: 'one,two \n three,four',
expectedValue: 'one\\\\\\\\two \n three\\\\\\\\four', // 2*8 backslashes.
expr: '%s/,/\\\\\\\\\\\\\\\\/g'}); // 16 backslashes.
-testSubstitute('ex_substitute_dollar_match', {
+testSubstitute('ex_substitute_dollar_assertion', {
value: 'one,two \n three,four',
- expectedValue: 'one,two ,\n three,four',
+ expectedValue: 'one,two ,\n three,four,',
expr: '%s/$/,/g'});
+testSubstitute('ex_substitute_dollar_assertion_empty_lines', {
+ value: '\n\n\n\n\n\n',
+ expectedValue: ';\n;\n;\n;\n;\n;\n;',
+ expr: '%s/$/;/g'});
+testSubstitute('ex_substitute_dollar_literal', {
+ value: 'one$two\n$three\nfour$\n$',
+ expectedValue: 'one,two\n,three\nfour,\n,',
+ expr: '%s/\\$/,/g'});
testSubstitute('ex_substitute_newline_match', {
value: 'one,two \n three,four',
expectedValue: 'one,two , three,four',
expr: '%s/\\n/,/g'});
+testSubstitute('ex_substitute_newline_join_global', {
+ value: 'one,two \n three,four \n five \n six',
+ expectedValue: 'one,two \n three,four , five \n six',
+ expr: '2s/\\n/,/g'});
+testSubstitute('ex_substitute_newline_join_noglobal', {
+ value: 'one,two \n three,four \n five \n six\n',
+ expectedValue: 'one,two \n three,four , five , six\n',
+ expr: '2,3s/\\n/,/'});
testSubstitute('ex_substitute_newline_replacement', {
- value: 'one,two \n three,four',
- expectedValue: 'one\ntwo \n three\nfour',
+ value: 'one,two, \n three,four,',
+ expectedValue: 'one\ntwo\n \n three\nfour\n',
expr: '%s/,/\\n/g'});
+testSubstitute('ex_substitute_newline_multiple_splits', {
+ value: 'one,two, \n three,four,five,six, \n seven,',
+ expectedValue: 'one,two, \n three\nfour\nfive\nsix\n \n seven,',
+ expr: '2s/,/\\n/g'});
+testSubstitute('ex_substitute_newline_first_occurrences', {
+ value: 'one,two, \n three,four,five,six, \n seven,',
+ expectedValue: 'one\ntwo, \n three\nfour,five,six, \n seven\n',
+ expr: '%s/,/\\n/'});
testSubstitute('ex_substitute_braces_word', {
value: 'ababab abb ab{2}',
expectedValue: 'ab abb ab{2}',
@@ -4155,48 +4263,29 @@ testSubstitute('ex_substitute_not_global', {
value: 'aaa\nbaa\ncaa',
expectedValue: 'xaa\nbxa\ncxa',
expr: '%s/a/x/'});
+testSubstitute('ex_substitute_optional', {
+ value: 'aaa aa\n aa',
+ expectedValue: ' <> \n<> ',
+ expr: '%s/(a*)/<$1>/g',
+ noPcreExpr: '%s/\\(a*\\)/<\\1>/g'});
+testSubstitute('ex_substitute_empty_match', {
+ value: 'aaa aa\n aa\nbb\n',
+ expectedValue: ' \n \nbb<>\n<>',
+ expr: '%s/(a+|$)/<$1>/g',
+ noPcreExpr: '%s/\\(a+\\|$\\)/<\\1>/g'});
+testSubstitute('ex_substitute_empty_or_match', {
+ value: '1234\n567\n89\n0\n',
+ expectedValue: '<12><34>\n<56>7<>\n<89>\n0<>\n<>',
+ expr: '%s/(..|$)/<$1>/g',
+ noPcreExpr: '%s/\\(..\\|$\\)/<\\1>/g'});
function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) {
testVim(name, function(cm, vim, helpers) {
- var savedOpenDialog = cm.openDialog;
- var savedKeyName = CodeMirror.keyName;
- var onKeyDown;
- var recordedCallback;
- var closed = true; // Start out closed, set false on second openDialog.
- function close() {
- closed = true;
- }
- // First openDialog should save callback.
- cm.openDialog = function(template, callback, options) {
- recordedCallback = callback;
- }
- // Do first openDialog.
- helpers.doKeys(':');
- // Second openDialog should save keyDown handler.
- cm.openDialog = function(template, callback, options) {
- onKeyDown = options.onKeyDown;
- closed = false;
- };
- // Return the command to Vim and trigger second openDialog.
- recordedCallback(command);
- // The event should really use keyCode, but here just mock it out and use
- // key and replace keyName to just return key.
- CodeMirror.keyName = function (e) { return e.key; }
- keys = keys.toUpperCase();
+ helpers.doEx(command);
for (var i = 0; i < keys.length; i++) {
- is(!closed);
- onKeyDown({ key: keys.charAt(i) }, '', close);
- }
- try {
- eq(expectedValue, cm.getValue());
- helpers.assertCursorAt(finalPos);
- is(closed);
- } catch(e) {
- throw e
- } finally {
- // Restore overridden functions.
- CodeMirror.keyName = savedKeyName;
- cm.openDialog = savedOpenDialog;
+ helpers.doKeys(keys.charAt(i))
}
+ eq(expectedValue, cm.getValue());
+ helpers.assertCursorAt(finalPos);
}, { value: initialValue });
}
testSubstituteConfirm('ex_substitute_confirm_emptydoc',
@@ -4229,8 +4318,7 @@ testSubstituteConfirm('ex_substitute_confirm_range_last',
'1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0));
//:noh should clear highlighting of search-results but allow to resume search through n
testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) {
- cm.openDialog = helpers.fakeOpenDialog('match');
- helpers.doKeys('?');
+ helpers.doKeys('?', 'match', '\n');
helpers.doEx('noh');
eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared');
helpers.doKeys('n');
@@ -4427,9 +4515,8 @@ testVim('ex_unmap_key2key', function(cm, vim, helpers) {
CodeMirror.Vim.mapclear();
}, { value: 'abc' });
testVim('ex_unmap_key2key_does_not_remove_default', function(cm, vim, helpers) {
- expectFail(function() {
- helpers.doEx('unmap a');
- });
+ helpers.doEx('unmap a');
+ is(/No such mapping: unmap a/.test(helpers.getNotificationText()));
helpers.doKeys('a');
eq('vim-insert', cm.getOption('keyMap'));
CodeMirror.Vim.mapclear();
@@ -4580,6 +4667,15 @@ testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) {
CodeMirror.Vim.mapclear();
}, { value: 'abc' });
+testVim('map in normal mode', function(cm, vim, helpers) {
+ CodeMirror.Vim.noremap('', 'i', 'normal');
+ helpers.doKeys('');
+ is(vim.insertMode, "Didn't switch to insert mode.");
+ helpers.doKeys('');
+ is(!vim.insertMode, "Didn't switch to normal mode.");
+ CodeMirror.Vim.mapclear();
+});
+
testVim('noremap', function(cm, vim, helpers) {
CodeMirror.Vim.noremap(';', 'l');
cm.setCursor(0, 0);
@@ -4600,10 +4696,10 @@ testVim('noremap_swap', function(cm, vim, helpers) {
cm.setCursor(0, 0);
// 'a' should act like 'i'.
helpers.doKeys('a');
- eqCursorPos(Pos(0, 0), cm.getCursor());
+ eqCursorPos(new Pos(0, 0), cm.getCursor());
// ...and 'i' should act like 'a'.
helpers.doKeys('', 'i');
- eqCursorPos(Pos(0, 1), cm.getCursor());
+ eqCursorPos(new Pos(0, 1), cm.getCursor());
// unmap all mappings
CodeMirror.Vim.mapclear();
}, { value: 'foo' });
@@ -4614,13 +4710,13 @@ testVim('noremap_map_interaction', function(cm, vim, helpers) {
CodeMirror.Vim.map('l', 'j');
cm.setCursor(0, 0);
helpers.doKeys(';');
- eqCursorPos(Pos(0, 1), cm.getCursor());
+ eqCursorPos(new Pos(0, 1), cm.getCursor());
helpers.doKeys('l');
- eqCursorPos(Pos(1, 1), cm.getCursor());
+ eqCursorPos(new Pos(1, 1), cm.getCursor());
// map should be able to point to a noremap
CodeMirror.Vim.map('m', ';');
helpers.doKeys('m');
- eqCursorPos(Pos(1, 2), cm.getCursor());
+ eqCursorPos(new Pos(1, 2), cm.getCursor());
// unmap all mappings
CodeMirror.Vim.mapclear();
}, { value: 'wOrd1\nwOrd2' });
@@ -4631,9 +4727,9 @@ testVim('noremap_map_interaction2', function(cm, vim, helpers) {
CodeMirror.Vim.noremap(';', 'h');
cm.setCursor(0, 0);
helpers.doKeys('l');
- eqCursorPos(Pos(0, 1), cm.getCursor());
+ eqCursorPos(new Pos(0, 1), cm.getCursor());
helpers.doKeys('m');
- eqCursorPos(Pos(0, 0), cm.getCursor());
+ eqCursorPos(new Pos(0, 0), cm.getCursor());
// unmap all mappings
CodeMirror.Vim.mapclear();
}, { value: 'wOrd1\nwOrd2' });
@@ -4891,3 +4987,187 @@ testVim('increment_hexadecimal', function(cm, vim, helpers) {
helpers.doKeys('');
eq('0x00', cm.getValue());
}, { value: '0x0' });
+
+var typeKey = function() {
+ var keyCodeToKey = {};
+ var keyCodeToCode = {};
+
+ var alias = {};
+ alias.Ctrl = "Control";
+ alias.Option = "Alt";
+ alias.Cmd = alias.Super = alias.Meta = "Command";
+
+ var controlKeys = {
+ Shift: 16, Control: 17, Alt: 18, Meta: 224, Command: 224,
+ Backspace:8, Tab:9, Return: 13, Enter: 13,
+ Pause: 19, Escape: 27, PageUp: 33, PageDown: 34, End: 35, Home: 36,
+ Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46,
+ ArrowLeft: 37, ArrowUp: 38, ArrowRight: 39, ArrowDown: 40,
+ };
+ var shiftedKeys = {};
+ var printableKeys = {};
+ var specialKeys = {
+ Backquote: [192, "`", "~"], Minus: [189, "-", "_"], Equal: [187, "=", "+"],
+ BracketLeft: [219, "[", "{"], Backslash: [220, "\\", "|"], BracketRight: [221, "]", "}"],
+ Semicolon: [186, ";", ":"], Quote: [222, "'", '"'], Comma: [188, ",", "<"],
+ Period: [190, ".", ">"], Slash: [191, "/", "?"], Space: [32, " "], NumpadAdd: [107, "+"],
+ NumpadDecimal: [110, "."], NumpadSubtract: [109, "-"], NumpadDivide: [111, "/"], NumpadMultiply: [106, "*"]
+ };
+ for (var i in specialKeys) {
+ var key = specialKeys[i];
+ printableKeys[i] = printableKeys[key[1]] = shiftedKeys[key[2]] = key[0];
+ keyCodeToCode[key[0]] = i;
+ }
+ for (var i = 0; i < 10; i++) {
+ printableKeys[i] = shiftedKeys["!@#$%^&*()"[i]] = 48 + i;
+ keyCodeToCode[48 + i] = "Digit" + i;
+ }
+ for (var i = 65; i < 90; i++) {
+ var chr = String.fromCharCode(i + 32);
+ printableKeys[chr] = shiftedKeys[chr.toUpperCase()] = i;
+ keyCodeToCode[i] = "Key" + chr.toUpperCase();
+ }
+ for (var i = 1; i < 13; i++) {
+ controlKeys["F" + i] = 111 + i;
+ }
+
+ for (var i in controlKeys) {
+ keyCodeToKey[controlKeys[i]] = i;
+ keyCodeToCode[controlKeys[i]] = i;
+ }
+ controlKeys["\n"] = controlKeys.Return;
+ controlKeys.Del = controlKeys.Delete;
+ controlKeys.Esc = controlKeys.Escape;
+ controlKeys.Ins = controlKeys.Insert;
+
+ var shift = false;
+ var ctrl = false;
+ var meta = false;
+ var alt = false;
+ function reset() {
+ shift = ctrl = meta = alt = false;
+ }
+ function updateModifierStates(keyCode) {
+ if (keyCode == controlKeys.Shift)
+ return shift = true;
+ if (keyCode == controlKeys.Control)
+ return ctrl = true;
+ if (keyCode == controlKeys.Meta)
+ return meta = true;
+ if (keyCode == controlKeys.Alt)
+ return alt = true;
+ }
+
+ function sendKey(letter, timeout) {
+ var keyCode = controlKeys[letter] || printableKeys[letter] || shiftedKeys[letter];
+ var isModifier = updateModifierStates(keyCode);
+
+ var text = letter;
+ var isTextInput = true;
+ if (ctrl || alt || meta || controlKeys[letter]) {
+ isTextInput = false;
+ } else if (shift) {
+ text = text.toUpperCase();
+ }
+
+ var target = document.activeElement;
+ var prevented = emit("keydown", true);
+ if (isModifier) return;
+ if (!prevented && isTextInput) prevented = emit("keypress", true);
+ if (!prevented && ctrl && !alt && !meta && letter == "c") emitClipboard("copy");
+ if (!prevented) updateTextInput();
+ emit("keyup", true);
+
+ function emitClipboard(type) {
+ var data = {bubbles: true, cancelable:true};
+ var event = new KeyboardEvent(type, data);
+ event.clipboardData = {
+ setData: function() {},
+ getData: function() {},
+ clearData: function() {},
+ };
+ target.dispatchEvent(event);
+ }
+ function emit(type, bubbles) {
+ var el = document.activeElement;
+ var data = {bubbles: bubbles, cancelable:true};
+ data.charCode = text.charCodeAt(0);
+ data.keyCode = type == "keypress" ? data.charCode : keyCode;
+ data.which = data.keyCode;
+ data.shiftKey = shift || shiftedKeys[text];
+ data.ctrlKey = ctrl;
+ data.altKey = alt;
+ data.metaKey = meta;
+ data.key = text || keyCodeToKey[keyCode];
+ data.code = keyCodeToCode[keyCode];
+ var event = new KeyboardEvent(type, data);
+
+ var el = document.activeElement;
+ el.dispatchEvent(event);
+ return event.defaultPrevented;
+ }
+ function updateTextInput() {
+ if (!isTextInput && keyCode == controlKeys.Return) {
+ text = "\n";
+ }
+ if (target._handleInputEventForTest) {
+ return target._handleInputEventForTest(text);
+ }
+ var isTextarea = "selectionStart" in target && typeof target.value == "string";
+ if (!isTextarea) return;
+
+ var start = target.selectionStart;
+ var end = target.selectionEnd;
+ var value = target.value;
+
+ if (!isTextInput) {
+ if (keyCode == controlKeys.Backspace) {
+ if (start != end) start = Math.max(start - 1, 0);
+ } else if (keyCode == controlKeys.Delete) {
+ if (start != end) end = Math.min(end + 1, value.length);
+ } else {
+ return;
+ }
+ }
+ var newValue = value.slice(0, start) + text + value.slice(end);
+ var newStart = start + text.length;
+ var newEnd = newStart;
+ if (newValue != value || newStart != start || newEnd != end) {
+ target.value = newValue;
+ target.setSelectionRange(newStart, newEnd);
+ emit("input", false);
+ }
+ }
+ }
+
+ function type() {
+ var keys = Array.prototype.slice.call(arguments);
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if (Array.isArray(key)) {
+ type.apply(null, key);
+ continue;
+ }
+ reset();
+ if (key.length > 1) {
+ var isKeyName = controlKeys[key] || printableKeys[key] || shiftedKeys[key];
+ if (!isKeyName) {
+ var parts = key.split("-");
+ var modifier = alias[parts[0]] || parts[0];
+ if (!updateModifierStates(controlKeys[modifier])) {
+ type.apply(null, key.split(""));
+ continue;
+ }
+ key = parts.pop();
+ parts.forEach(function(part) {
+ var keyCode = controlKeys[part];
+ updateModifierStates(keyCode);
+ });
+ }
+ }
+ sendKey(key);
+ }
+ }
+
+ return type;
+}();
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/abbott.css b/Mod manager/utils/QNModManager/CodeMirror/theme/abbott.css
new file mode 100644
index 00000000..3e516a67
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/abbott.css
@@ -0,0 +1,268 @@
+/*
+ * abbott.css
+ * A warm, dark theme for prose and code, with pastels and pretty greens.
+ *
+ * Ported from abbott.vim (https://github.com/bcat/abbott.vim) version 2.1.
+ * Original design and CodeMirror port by Jonathan Rascher.
+ *
+ * This theme shares the following color palette with the Vim color scheme.
+ *
+ * Brown shades:
+ * bistre: #231c14
+ * chocolate: #3c3022
+ * cocoa: #745d42
+ * vanilla_cream: #fef3b4
+ *
+ * Red shades:
+ * crimson: #d80450
+ * cinnabar: #f63f05
+ *
+ * Green shades:
+ * dark_olive: #273900
+ * forest_green: #24a507
+ * chartreuse: #a0ea00
+ * pastel_chartreuse: #d8ff84
+ *
+ * Yellow shades:
+ * marigold: #fbb32f
+ * lemon_meringue: #fbec5d
+ *
+ * Blue shades:
+ * cornflower_blue: #3f91f1
+ * periwinkle_blue: #8ccdf0
+ *
+ * Magenta shades:
+ * french_pink: #ec6c99
+ * lavender: #e6a2f3
+ *
+ * Cyan shades:
+ * zomp: #39a78d
+ * seafoam_green: #00ff7f
+ */
+
+/* Style the UI: */
+
+/* Equivalent to Vim's Normal group. */
+.cm-s-abbott.CodeMirror {
+ background: #231c14 /* bistre */;
+ color: #d8ff84 /* pastel_chartreuse */;
+}
+
+/* Roughly equivalent to Vim's LineNr group. */
+.cm-s-abbott .CodeMirror-gutters {
+ background: #231c14 /* bistre */;
+ border: none;
+}
+.cm-s-abbott .CodeMirror-linenumber { color: #fbec5d /* lemon_meringue */; }
+
+.cm-s-abbott .CodeMirror-guttermarker { color: #f63f05 /* cinnabar */; }
+
+/* Roughly equivalent to Vim's FoldColumn group. */
+.cm-s-abbott .CodeMirror-guttermarker-subtle { color: #fbb32f /* marigold */; }
+
+/*
+ * Roughly equivalent to Vim's CursorColumn group. (We use a brighter color
+ * since Vim's cursorcolumn option highlights a whole column, whereas
+ * CodeMirror's rule just highlights a thin line.)
+ */
+.cm-s-abbott .CodeMirror-ruler { border-color: #745d42 /* cocoa */; }
+
+/* Equivalent to Vim's Cursor group in insert mode. */
+.cm-s-abbott .CodeMirror-cursor { border-color: #a0ea00 /* chartreuse */; }
+
+/* Equivalent to Vim's Cursor group in normal mode. */
+.cm-s-abbott.cm-fat-cursor .CodeMirror-cursor,
+.cm-s-abbott .cm-animate-fat-cursor {
+ /*
+ * CodeMirror doesn't allow changing the foreground color of the character
+ * under the cursor, so we can't use a reverse video effect for the cursor.
+ * Instead, make it semitransparent.
+ */
+ background: rgba(160, 234, 0, 0.5) /* chartreuse */;
+}
+.cm-s-abbott.cm-fat-cursor .CodeMirror-cursors {
+ /*
+ * Boost the z-index so the fat cursor shows up on top of text and
+ * matchingbracket/matchingtag highlights.
+ */
+ z-index: 3;
+}
+
+/* Equivalent to Vim's Cursor group in replace mode. */
+.cm-s-abbott .CodeMirror-overwrite .CodeMirror-cursor {
+ border-bottom: 1px solid #a0ea00 /* chartreuse */;
+ border-left: none;
+ width: auto;
+}
+
+/* Roughly equivalent to Vim's CursorIM group. */
+.cm-s-abbott .CodeMirror-secondarycursor {
+ border-color: #00ff7f /* seafoam_green */;
+}
+
+/* Roughly equivalent to Vim's Visual group. */
+.cm-s-abbott .CodeMirror-selected,
+.cm-s-abbott.CodeMirror-focused .CodeMirror-selected {
+ background: #273900 /* dark_olive */;
+}
+.cm-s-abbott .CodeMirror-line::selection,
+.cm-s-abbott .CodeMirror-line > span::selection,
+.cm-s-abbott .CodeMirror-line > span > span::selection {
+ background: #273900 /* dark_olive */;
+}
+.cm-s-abbott .CodeMirror-line::-moz-selection,
+.cm-s-abbott .CodeMirror-line > span::-moz-selection,
+.cm-s-abbott .CodeMirror-line > span > span::-moz-selection {
+ background: #273900 /* dark_olive */;
+}
+
+/* Roughly equivalent to Vim's SpecialKey group. */
+.cm-s-abbott .cm-tab { color: #00ff7f /* seafoam_green */; }
+
+/* Equivalent to Vim's Search group. */
+.cm-s-abbott .cm-searching {
+ background: #fef3b4 /* vanilla_cream */ !important;
+ color: #231c14 /* bistre */ !important;
+}
+
+/* Style syntax highlighting modes: */
+
+/* Equivalent to Vim's Comment group. */
+.cm-s-abbott span.cm-comment {
+ color: #fbb32f /* marigold */;
+ font-style: italic;
+}
+
+/* Equivalent to Vim's String group. */
+.cm-s-abbott span.cm-string,
+.cm-s-abbott span.cm-string-2 {
+ color: #e6a2f3 /* lavender */;
+}
+
+/* Equivalent to Vim's Constant group. */
+.cm-s-abbott span.cm-number,
+.cm-s-abbott span.cm-string.cm-url { color: #f63f05 /* cinnabar */; }
+
+/* Roughly equivalent to Vim's SpecialKey group. */
+.cm-s-abbott span.cm-invalidchar { color: #00ff7f /* seafoam_green */; }
+
+/* Equivalent to Vim's Special group. */
+.cm-s-abbott span.cm-atom { color: #fef3b4 /* vanilla_cream */; }
+
+/* Equivalent to Vim's Delimiter group. */
+.cm-s-abbott span.cm-bracket,
+.cm-s-abbott span.cm-punctuation {
+ color: #fef3b4 /* vanilla_cream */;
+}
+
+/* Equivalent Vim's Operator group. */
+.cm-s-abbott span.cm-operator { font-weight: bold; }
+
+/* Roughly equivalent to Vim's Identifier group. */
+.cm-s-abbott span.cm-def,
+.cm-s-abbott span.cm-variable,
+.cm-s-abbott span.cm-variable-2,
+.cm-s-abbott span.cm-variable-3 {
+ color: #8ccdf0 /* periwinkle_blue */;
+}
+
+/* Roughly equivalent to Vim's Function group. */
+.cm-s-abbott span.cm-builtin,
+.cm-s-abbott span.cm-property,
+.cm-s-abbott span.cm-qualifier {
+ color: #3f91f1 /* cornflower_blue */;
+}
+
+/* Equivalent to Vim's Type group. */
+.cm-s-abbott span.cm-type { color: #24a507 /* forest_green */; }
+
+/* Equivalent to Vim's Keyword group. */
+.cm-s-abbott span.cm-keyword {
+ color: #d80450 /* crimson */;
+ font-weight: bold;
+}
+
+/* Equivalent to Vim's PreProc group. */
+.cm-s-abbott span.cm-meta { color: #ec6c99 /* french_pink */; }
+
+/* Equivalent to Vim's htmlTagName group (linked to Statement). */
+.cm-s-abbott span.cm-tag {
+ color: #d80450 /* crimson */;
+ font-weight: bold;
+}
+
+/* Equivalent to Vim's htmlArg group (linked to Type). */
+.cm-s-abbott span.cm-attribute { color: #24a507 /* forest_green */; }
+
+/* Equivalent to Vim's htmlH1, markdownH1, etc. groups (linked to Title). */
+.cm-s-abbott span.cm-header {
+ color: #d80450 /* crimson */;
+ font-weight: bold;
+}
+
+/* Equivalent to Vim's markdownRule group (linked to PreProc). */
+.cm-s-abbott span.cm-hr { color: #ec6c99 /* french_pink */; }
+
+/* Roughly equivalent to Vim's Underlined group. */
+.cm-s-abbott span.cm-link { color: #e6a2f3 /* lavender */; }
+
+/* Equivalent to Vim's diffRemoved group. */
+.cm-s-abbott span.cm-negative {
+ background: #d80450 /* crimson */;
+ color: #231c14 /* bistre */;
+}
+
+/* Equivalent to Vim's diffAdded group. */
+.cm-s-abbott span.cm-positive {
+ background: #a0ea00 /* chartreuse */;
+ color: #231c14 /* bistre */;
+ font-weight: bold;
+}
+
+/* Equivalent to Vim's Error group. */
+.cm-s-abbott span.cm-error {
+ background: #d80450 /* crimson */;
+ color: #231c14 /* bistre */;
+}
+
+/* Style addons: */
+
+/* Equivalent to Vim's MatchParen group. */
+.cm-s-abbott span.CodeMirror-matchingbracket {
+ background: #745d42 /* cocoa */ !important;
+ color: #231c14 /* bistre */ !important;
+ font-weight: bold;
+}
+
+/*
+ * Roughly equivalent to Vim's Error group. (Vim doesn't seem to have a direct
+ * equivalent in its own matchparen plugin, but many syntax highlighting plugins
+ * mark mismatched brackets as Error.)
+ */
+.cm-s-abbott span.CodeMirror-nonmatchingbracket {
+ background: #d80450 /* crimson */ !important;
+ color: #231c14 /* bistre */ !important;
+}
+
+.cm-s-abbott .CodeMirror-matchingtag,
+.cm-s-abbott .cm-matchhighlight {
+ outline: 1px solid #39a78d /* zomp */;
+}
+
+/* Equivalent to Vim's CursorLine group. */
+.cm-s-abbott .CodeMirror-activeline-background,
+.cm-s-abbott .CodeMirror-activeline-gutter {
+ background: #3c3022 /* chocolate */;
+}
+
+/* Equivalent to Vim's CursorLineNr group. */
+.cm-s-abbott .CodeMirror-activeline-gutter .CodeMirror-linenumber {
+ color: #d8ff84 /* pastel_chartreuse */;
+ font-weight: bold;
+}
+
+/* Roughly equivalent to Vim's Folded group. */
+.cm-s-abbott .CodeMirror-foldmarker {
+ color: #f63f05 /* cinnabar */;
+ text-shadow: none;
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-dark.css b/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-dark.css
index fd41ba3e..13656b94 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-dark.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-dark.css
@@ -9,6 +9,8 @@
.cm-s-ayu-dark .CodeMirror-guttermarker-subtle { color: #3d424d; }
.cm-s-ayu-dark .CodeMirror-linenumber { color: #3d424d; }
.cm-s-ayu-dark .CodeMirror-cursor { border-left: 1px solid #e6b450; }
+.cm-s-ayu-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #a2a8a175 !important; }
+.cm-s-ayu-dark .cm-animate-fat-cursor { background-color: #a2a8a175 !important; }
.cm-s-ayu-dark span.cm-comment { color: #626a73; }
.cm-s-ayu-dark span.cm-atom { color: #ae81ff; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-mirage.css b/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-mirage.css
index 7a5b50ce..19403cef 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-mirage.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/ayu-mirage.css
@@ -8,7 +8,9 @@
.cm-s-ayu-mirage .CodeMirror-guttermarker { color: white; }
.cm-s-ayu-mirage .CodeMirror-guttermarker-subtle { color: rgba(112, 122, 140, 66); }
.cm-s-ayu-mirage .CodeMirror-linenumber { color: rgba(61, 66, 77, 99); }
-.cm-s-ayu-mirage .CodeMirror-cursor { border-left: 1px solid #ffcc66; }
+.cm-s-ayu-mirage .CodeMirror-cursor { border-left: 1px solid #ffcc66; }
+.cm-s-ayu-mirage.cm-fat-cursor .CodeMirror-cursor {background-color: #a2a8a175 !important;}
+.cm-s-ayu-mirage .cm-animate-fat-cursor { background-color: #a2a8a175 !important; }
.cm-s-ayu-mirage span.cm-comment { color: #5c6773; font-style:italic; }
.cm-s-ayu-mirage span.cm-atom { color: #ae81ff; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/base16-dark.css b/Mod manager/utils/QNModManager/CodeMirror/theme/base16-dark.css
index 026a8168..b3c31aba 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/base16-dark.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/base16-dark.css
@@ -17,6 +17,8 @@
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }
.cm-s-base16-dark .CodeMirror-linenumber { color: #505050; }
.cm-s-base16-dark .CodeMirror-cursor { border-left: 1px solid #b0b0b0; }
+.cm-s-base16-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #8e8d8875 !important; }
+.cm-s-base16-dark .cm-animate-fat-cursor { background-color: #8e8d8875 !important; }
.cm-s-base16-dark span.cm-comment { color: #8f5536; }
.cm-s-base16-dark span.cm-atom { color: #aa759f; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/gruvbox-dark.css b/Mod manager/utils/QNModManager/CodeMirror/theme/gruvbox-dark.css
index ded215f5..d712dda0 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/gruvbox-dark.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/gruvbox-dark.css
@@ -11,6 +11,8 @@
.cm-s-gruvbox-dark .CodeMirror-gutters {background: #282828; border-right: 0px;}
.cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;}
.cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; }
+.cm-s-gruvbox-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #8e8d8875 !important; }
+.cm-s-gruvbox-dark .cm-animate-fat-cursor { background-color: #8e8d8875 !important; }
.cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; }
.cm-s-gruvbox-dark span.cm-meta { color: #83a598; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/juejin.css b/Mod manager/utils/QNModManager/CodeMirror/theme/juejin.css
new file mode 100644
index 00000000..38cf7fe3
--- /dev/null
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/juejin.css
@@ -0,0 +1,30 @@
+.cm-s-juejin.CodeMirror {
+ background: #f8f9fa;
+}
+.cm-s-juejin .cm-header,
+.cm-s-juejin .cm-def {
+ color: #1ba2f0;
+}
+.cm-s-juejin .cm-comment {
+ color: #009e9d;
+}
+.cm-s-juejin .cm-quote,
+.cm-s-juejin .cm-link,
+.cm-s-juejin .cm-strong,
+.cm-s-juejin .cm-attribute {
+ color: #fd7741;
+}
+.cm-s-juejin .cm-url,
+.cm-s-juejin .cm-keyword,
+.cm-s-juejin .cm-builtin {
+ color: #bb51b8;
+}
+.cm-s-juejin .cm-hr {
+ color: #909090;
+}
+.cm-s-juejin .cm-tag {
+ color: #107000;
+}
+.cm-s-juejin .cm-variable-2 {
+ color: #0050a0;
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/material-ocean.css b/Mod manager/utils/QNModManager/CodeMirror/theme/material-ocean.css
index 86a6f3cd..404178de 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/material-ocean.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/material-ocean.css
@@ -24,6 +24,12 @@
.cm-s-material-ocean .CodeMirror-cursor {
border-left: 1px solid #FFCC00;
}
+.cm-s-material-ocean.cm-fat-cursor .CodeMirror-cursor {
+ background-color: #a2a8a175 !important;
+}
+.cm-s-material-ocean .cm-animate-fat-cursor {
+ background-color: #a2a8a175 !important;
+}
.cm-s-material-ocean div.CodeMirror-selected {
background: rgba(113, 124, 180, 0.2);
@@ -132,4 +138,4 @@
.cm-s-material-ocean .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
-}
\ No newline at end of file
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/material-palenight.css b/Mod manager/utils/QNModManager/CodeMirror/theme/material-palenight.css
index 66d53dd3..6712c43a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/material-palenight.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/material-palenight.css
@@ -24,6 +24,12 @@
.cm-s-material-palenight .CodeMirror-cursor {
border-left: 1px solid #FFCC00;
}
+.cm-s-material-palenight.cm-fat-cursor .CodeMirror-cursor {
+ background-color: #607c8b80 !important;
+}
+.cm-s-material-palenight .cm-animate-fat-cursor {
+ background-color: #607c8b80 !important;
+}
.cm-s-material-palenight div.CodeMirror-selected {
background: rgba(113, 124, 180, 0.2);
@@ -132,4 +138,4 @@
.cm-s-material-palenight .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
-}
\ No newline at end of file
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/material.css b/Mod manager/utils/QNModManager/CodeMirror/theme/material.css
index 9ac17a36..a7848499 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/material.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/material.css
@@ -24,6 +24,12 @@
.cm-s-material .CodeMirror-cursor {
border-left: 1px solid #FFCC00;
}
+.cm-s-material.cm-fat-cursor .CodeMirror-cursor {
+ background-color: #5d6d5c80 !important;
+}
+.cm-s-material .cm-animate-fat-cursor {
+ background-color: #5d6d5c80 !important;
+}
.cm-s-material div.CodeMirror-selected {
background: rgba(128, 203, 196, 0.2);
@@ -132,4 +138,4 @@
.cm-s-material .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
-}
\ No newline at end of file
+}
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/oceanic-next.css b/Mod manager/utils/QNModManager/CodeMirror/theme/oceanic-next.css
index 296277ba..f3d0d08a 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/oceanic-next.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/oceanic-next.css
@@ -16,6 +16,8 @@
.cm-s-oceanic-next .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-oceanic-next .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-oceanic-next .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
+.cm-s-oceanic-next.cm-fat-cursor .CodeMirror-cursor { background-color: #a2a8a175 !important; }
+.cm-s-oceanic-next .cm-animate-fat-cursor { background-color: #a2a8a175 !important; }
.cm-s-oceanic-next span.cm-comment { color: #65737E; }
.cm-s-oceanic-next span.cm-atom { color: #C594C5; }
diff --git a/Mod manager/utils/QNModManager/CodeMirror/theme/solarized.css b/Mod manager/utils/QNModManager/CodeMirror/theme/solarized.css
index fcd1d70d..e978fec9 100644
--- a/Mod manager/utils/QNModManager/CodeMirror/theme/solarized.css
+++ b/Mod manager/utils/QNModManager/CodeMirror/theme/solarized.css
@@ -35,12 +35,10 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized.cm-s-dark {
color: #839496;
background-color: #002b36;
- text-shadow: #002b36 0 1px;
}
.cm-s-solarized.cm-s-light {
background-color: #fdf6e3;
color: #657b83;
- text-shadow: #eee8d5 0 1px;
}
.cm-s-solarized .CodeMirror-widget {
@@ -99,7 +97,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized.cm-s-light div.CodeMirror-selected { background: #eee8d5; }
.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; }
-.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; }
+.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-light .CodeMirror-line > span::-moz-selection, .cm-s-light .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; }
/* Editor styling */
@@ -126,7 +124,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {
color: #586e75;
- text-shadow: #021014 0 -1px;
}
/* Light */
diff --git a/Multirow and other functions/JS Loader/root/config.js b/Multirow and other functions/JS Loader/root/config.js
index 27582d02..69a2072e 100644
--- a/Multirow and other functions/JS Loader/root/config.js
+++ b/Multirow and other functions/JS Loader/root/config.js
@@ -1,8 +1,26 @@
// skip 1st line
+lockPref('xpinstall.signatures.required', false);
+
+Object = Cu.getGlobalForObject(Cu).Object;
+const { freeze } = Object;
+Object.freeze = obj => {
+ if (Components.stack.caller.filename != 'resource://gre/modules/AppConstants.jsm')
+ return freeze(obj);
+
+ obj.MOZ_REQUIRE_SIGNING = false;
+ Object.freeze = freeze;
+ return freeze(obj);
+}
+
try {
+ let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
+ cmanifest.append('utils');
+ cmanifest.append('chrome.manifest');
+ Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
- let Cu = Components.utils;
- Cu.import('resource://gre/modules/osfile.jsm');
- Cu.import(OS.Path.toFileURI(OS.Constants.Path.profileDir)+ '/chrome/utils/boot.jsm');
+ Cu.import('chrome://userchromejs/content/BootstrapLoader.jsm');
+} catch (ex) {};
-} catch(ex) {};
+try {
+ Cu.import('chrome://userchromejs/content/userChrome.jsm');
+} catch (ex) {};
\ No newline at end of file
diff --git a/Multirow and other functions/JS Loader/root/defaults/pref/config-prefs.js b/Multirow and other functions/JS Loader/root/defaults/pref/config-prefs.js
index 57e8af3e..65ff8afe 100644
--- a/Multirow and other functions/JS Loader/root/defaults/pref/config-prefs.js
+++ b/Multirow and other functions/JS Loader/root/defaults/pref/config-prefs.js
@@ -1,3 +1,3 @@
pref("general.config.obscure_value", 0);
pref("general.config.filename", "config.js");
-pref("general.config.sandbox_enabled", false);
+pref("general.config.sandbox_enabled", false);
\ No newline at end of file
diff --git a/Multirow and other functions/JS Loader/utils/boot.jsm b/Multirow and other functions/JS Loader/utils/boot.jsm
deleted file mode 100644
index e5516153..00000000
--- a/Multirow and other functions/JS Loader/utils/boot.jsm
+++ /dev/null
@@ -1,14 +0,0 @@
-let EXPORTED_SYMBOLS = [];
-
-let {
- classes: Cc,
- interfaces: Ci,
- manager: Cm
-} = Components;
-
-var cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
-cmanifest.append('utils');
-cmanifest.append('chrome.manifest');
-Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);
-
-ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
diff --git a/Multirow and other functions/JS Loader/utils/userChrome.jsm b/Multirow and other functions/JS Loader/utils/userChrome.jsm
index 84ec226f..fde9f490 100644
--- a/Multirow and other functions/JS Loader/utils/userChrome.jsm
+++ b/Multirow and other functions/JS Loader/utils/userChrome.jsm
@@ -1,18 +1,26 @@
let EXPORTED_SYMBOLS = [];
-const {Services} = ChromeUtils.import('resource://gre/modules/Services.jsm');
-const {xPref} = ChromeUtils.import('chrome://userchromejs/content/xPref.jsm');
-
-let UC = {};
+const { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm');
+const { xPref } = ChromeUtils.import('chrome://userchromejs/content/xPref.jsm');
+const { Management } = ChromeUtils.import('resource://gre/modules/Extension.jsm');
+const { AppConstants } = ChromeUtils.import('resource://gre/modules/AppConstants.jsm');
+
+let UC = {
+ webExts: new Map(),
+ sidebar: new Map()
+};
let _uc = {
ALWAYSEXECUTE: 'userChrome.uc.js',
- BROWSERCHROME: 'chrome://browser/content/browser.xhtml',
+ BROWSERCHROME: AppConstants.MOZ_APP_NAME == 'thunderbird' ? 'chrome://messenger/content/messenger.xhtml' : 'chrome://browser/content/browser.xhtml',
+ BROWSERTYPE: AppConstants.MOZ_APP_NAME == 'thunderbird' ? 'mail:3pane' : 'navigator:browser',
+ BROWSERNAME: AppConstants.MOZ_APP_NAME.charAt(0).toUpperCase() + AppConstants.MOZ_APP_NAME.slice(1),
PREF_ENABLED: 'userChromeJS.enabled',
PREF_SCRIPTSDISABLED: 'userChromeJS.scriptsDisabled',
- BASE_FILEURI: Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler).getURLSpecFromDir(Services.dirsvc.get('UChrm', Ci.nsIFile)),
chromedir: Services.dirsvc.get('UChrm', Ci.nsIFile),
+ scriptsDir: '',
+
sss: Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService),
getScripts: function () {
@@ -24,8 +32,7 @@ let _uc = {
let fileURI = Services.io.newFileURI(file);
if (/\.uc\.js$/i.test(file.leafName)) {
_uc.getScriptData(file);
- }
- else if(/\.as\.css$/i.test(file.leafName)) {
+ } else if(/\.as\.css$/i.test(file.leafName)) {
if(!sss.sheetRegistered(fileURI, sss.AGENT_SHEET))
sss.loadAndRegisterSheet(fileURI, sss.AGENT_SHEET);
}
@@ -55,9 +62,8 @@ let _uc = {
return this.scripts[filename] = {
filename: filename,
file: aFile,
- url: this.BASE_FILEURI + filename,
+ url: Services.io.getProtocolHandler('file').QueryInterface(Ci.nsIFileProtocolHandler).getURLSpecFromDir(this.chromedir) + filename,
name: (header.match(/\/\/ @name\s+(.+)\s*$/im) || def)[1],
- charset: (header.match(/\/\/ @charset\s+(.+)\s*$/im) || def)[1],
description: (header.match(/\/\/ @description\s+(.+)\s*$/im) || def)[1],
version: (header.match(/\/\/ @version\s+(.+)\s*$/im) || def)[1],
author: (header.match(/\/\/ @author\s+(.+)\s*$/im) || def)[1],
@@ -109,11 +115,8 @@ let _uc = {
}
try {
- if (script.charset) {
- Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime, win, script.charset);
- } else {
- Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime, win, 'UTF-8');
- }
+ Services.scriptloader.loadSubScript(script.url + '?' + script.file.lastModifiedTime,
+ script.onlyonce ? { window: win } : win);
script.isRunning = true;
if (script.startup) {
eval(script.startup);
@@ -122,12 +125,12 @@ let _uc = {
this.everLoaded.push(script.id);
}
} catch (ex) {
- this.error(script.filename, ex);
+ Cu.reportError(ex);
}
},
windows: function (fun, onlyBrowsers = true) {
- let windows = Services.wm.getEnumerator(onlyBrowsers ? 'navigator:browser' : null);
+ let windows = Services.wm.getEnumerator(onlyBrowsers ? this.BROWSERTYPE : null);
while (windows.hasMoreElements()) {
let win = windows.getNext();
if (!win._uc)
@@ -156,16 +159,6 @@ let _uc = {
el.setAttribute(att, atts[att]);
}
return el
- },
-
- error: function (aMsg, err) {
- let error = Cc['@mozilla.org/scripterror;1'].createInstance(Ci.nsIScriptError);
- if (typeof err == 'object') {
- error.init(aMsg + '\n' + err.name + ' : ' + err.message, err.fileName || null, null, err.lineNumber, null, 2, err.name);
- } else {
- error.init(aMsg + '\n' + err + '\n', null, null, null, null, 2, null);
- }
- Services.console.logMessage(error);
}
};
@@ -177,12 +170,7 @@ if (xPref.get(_uc.PREF_SCRIPTSDISABLED) === undefined) {
xPref.set(_uc.PREF_SCRIPTSDISABLED, '', true);
}
-function UserChrome_js() {
- _uc.getScripts();
- Services.obs.addObserver(this, 'chrome-document-global-created', false);
-}
-
-UserChrome_js.prototype = {
+let UserChrome_js = {
observe: function (aSubject) {
aSubject.addEventListener('DOMContentLoaded', this, {once: true});
},
@@ -191,7 +179,14 @@ UserChrome_js.prototype = {
let document = aEvent.originalTarget;
let window = document.defaultView;
let location = window.location;
- if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
+
+ if (!this.sharedWindowOpened && location.href == 'chrome://extensions/content/dummy.xhtml') {
+ this.sharedWindowOpened = true;
+
+ Management.on('extension-browser-inserted', function (topic, browser) {
+ browser.messageManager.addMessageListener('Extension:ExtensionViewLoaded', this.messageListener.bind(this));
+ }.bind(this));
+ } else if (/^(chrome:(?!\/\/global\/content\/commonDialog\.x?html)|about:(?!blank))/i.test(location.href)) {
window.UC = UC;
window._uc = _uc;
window.xPref = xPref;
@@ -206,8 +201,27 @@ UserChrome_js.prototype = {
_uc.loadScript(_uc.scripts[_uc.ALWAYSEXECUTE], window);
}
}
+ },
+
+ messageListener: function (msg) {
+ const browser = msg.target;
+ const { addonId } = browser._contentPrincipal;
+
+ browser.messageManager.removeMessageListener('Extension:ExtensionViewLoaded', this.messageListener);
+
+ if (browser.ownerGlobal.location.href == 'chrome://extensions/content/dummy.xhtml') {
+ UC.webExts.set(addonId, browser);
+ Services.obs.notifyObservers(null, 'UCJS:WebExtLoaded', addonId);
+ } else {
+ let win = browser.ownerGlobal.windowRoot.ownerGlobal;
+ UC.sidebar.get(addonId)?.set(win, browser) || UC.sidebar.set(addonId, new Map([[win, browser]]));
+ Services.obs.notifyObservers(win, 'UCJS:SidebarLoaded', addonId);
+ }
}
};
-if (!Services.appinfo.inSafeMode)
- new UserChrome_js();
+if (!Services.appinfo.inSafeMode) {
+ _uc.chromedir.append(_uc.scriptsDir);
+ _uc.getScripts();
+ Services.obs.addObserver(UserChrome_js, 'chrome-document-global-created', false);
+}
diff --git a/Multirow and other functions/JS Loader/utils/xPref.jsm b/Multirow and other functions/JS Loader/utils/xPref.jsm
index 4bd35665..df07b7ba 100644
--- a/Multirow and other functions/JS Loader/utils/xPref.jsm
+++ b/Multirow and other functions/JS Loader/utils/xPref.jsm
@@ -38,7 +38,7 @@ var xPref = {
switch (typeof value) {
case 'string':
- return sPrefs.setCharPref(prefPath, value) || value;
+ return sPrefs.setStringPref(prefPath, value) || value;
case 'number':
return sPrefs.setIntPref(prefPath, value) || value;
case 'boolean':
diff --git a/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable-autohide.uc.js b/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable-autohide.uc.js
index 44685168..49017dd8 100644
--- a/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable-autohide.uc.js
+++ b/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable-autohide.uc.js
@@ -3,8 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with autohiding scrollbar
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 22/01/2022 16:50 Tab sizing fixes
// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
@@ -136,9 +137,13 @@ function zzzz_MultiRowTabLite() {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
+ }
+
+ .titlebar-buttonbox-container {
+ display: block !important;
}
*/
diff --git a/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable.uc.js b/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable.uc.js
index 90cda6c1..4822133a 100644
--- a/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable.uc.js
+++ b/Multirow and other functions/Multirow tabs/MultiRowTab-scrollable.uc.js
@@ -3,10 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with scrollable rows
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
-// @version 22/01/2022 16:50 Tab sizing fixes
-// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
// @version 10/09/2021 09:49 Fixed regression of pinned tabs icon showing unaligned
// @version 19/08/2021 03:15 Compatibility fix for FF91
@@ -123,35 +122,26 @@ function zzzz_MultiRowTabLite() {
/* These below control the padding of the new tab button and min/max/close buttons respectively.
YOU DON'T NEED TO CHANGE THESE unless you want to use values of --tab-min-height lower than 20px.
- Before changing them, you need to UNCOMMENT the 2 rules below for them TO TAKE EFFECT.
-
- The first rule (#TabsToolbar) controls the padding around the "new tab" button. Make sure to always use "px"
- as unit for it to work, even on 0 value. Reducing it will allow a lower limit on the tabs height.
-
- The second rule (.titlebar-buttonbox) has paddings control the padding of the min/max/close buttons.
- Changing these are required if you want the tab bar to be smaller when having 1 row. */
+ Before changing them, you need to UNCOMMENT the 2 rules below for them TO TAKE EFFECT. */
/*
#TabsToolbar {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
}
- */
-
- /*-------- Don't edit past here unless you know what you are doing --------*/
- /* These 2 rules are a fix to make sure that tabs become smaller on smaller --tab-min-height values */
- .tabbrowser-tab {
- max-height: calc(var(--tab-min-height) + var(--toolbarbutton-inner-padding)) !important;
+ .titlebar-buttonbox-container {
+ display: block !important;
}
- .toolbar-items {-moz-box-align: start !important}
+ */
+
+ /*-------- Don't edit past here unless you know what you are doing --------*/
- /* Common multirow code */
#navigator-toolbox:-moz-lwtheme {
background-color: var(--toolbar-bgcolor) !important;
}
@@ -192,7 +182,7 @@ function zzzz_MultiRowTabLite() {
/* A fix for pinned tabs triggering another row when only pinned tabs are shown in a row */
.tabbrowser-tab[pinned] {
- max-height: calc(var(--tab-min-height) + 8px);
+ height: calc(var(--tab-min-height) + 8px) !important;
}
/* This fixes the new tab button overflowing to the new row alone */
@@ -243,6 +233,8 @@ function zzzz_MultiRowTabLite() {
tabsHavePadding = true;
}
+ console.log(getComputedStyle(tabBackground).getPropertyValue('--tab-block-margin').substring(0,1))
+
// Here the FF71+ changes
if (document.querySelector("#tabbrowser-tabs > arrowscrollbox").shadowRoot) {
@@ -281,7 +273,7 @@ function zzzz_MultiRowTabLite() {
`;
// This is a fix for FF89+ (Proton)
- if (document.documentElement.hasAttribute("proton") || tabsHavePadding) {
+ if (tabsHavePadding) {
style.innerHTML += `
scrollbox {
max-height: calc((var(--tab-min-height) + 8px) * var(--max-tab-rows));
diff --git a/Multirow and other functions/Multirow tabs/MultiRowTabLiteforFx.uc.js b/Multirow and other functions/Multirow tabs/MultiRowTabLiteforFx.uc.js
index 482ddf1f..c43c1b7e 100644
--- a/Multirow and other functions/Multirow tabs/MultiRowTabLiteforFx.uc.js
+++ b/Multirow and other functions/Multirow tabs/MultiRowTabLiteforFx.uc.js
@@ -3,8 +3,9 @@
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
// @description Multi-row tabs draggability fix with unlimited rows
// @include main
-// @compatibility Firefox 70 to Firefox 94.0a1 (2021-09-14)
+// @compatibility Firefox 70 to Firefox 101.0a1 (2022-04-08)
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
+// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
// @version 22/01/2022 16:50 Tab sizing fixes
// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
@@ -109,9 +110,13 @@ function zzzz_MultiRowTabLite() {
--toolbarbutton-inner-padding: inherit !important;
}
- .titlebar-buttonbox .titlebar-button {
- padding-top: 8px !important;
- padding-bottom: 8px !important;
+ /* Sizing of the titlebar buttons */
+ .titlebar-buttonbox {
+ height: var(--tab-min-height) !important;
+ }
+
+ .titlebar-buttonbox-container {
+ display: block !important;
}
*/
diff --git a/README.md b/README.md
index 3fabdf40..c1c21be0 100644
--- a/README.md
+++ b/README.md
@@ -15,17 +15,19 @@ You can use it to fully change the colors of most of firefox UI to dark-gray col
If you want to know how to change some colors of the theme, check the [wiki](https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme/wiki/Editting-CSS-files).
-### Last update: 05/03/2022
+### Last update: 12/04/2022
Files updated:
-* __Mod manager (folder)__: Added the beta of the mod manager extension (used to auto-update mods).
+* __JS Loader (folder)__: Hot fix for JS Loader scripts, which would prevent them from working on nightly.
+* __Multirow*.uc.js__: The min/max/close buttons now stay the same height even when the window is resized on windows.
+* __Codemirror (folder)__: Updated the mod manager codemirror version to fix some security issues.
-### Pre-Last update: 26/02/2022
+### Pre-Last update: 05/03/2022
Files updated:
-* __Addons.css__: Updated Ublock origin addon dark theme to just fix some of the minor issues of the official dark theme.
+* __Mod manager (folder)__: Added the beta of the mod manager extension (used to auto-update mods).
### A note on people looking to replace some Tab Mix Plus features: