diff --git a/package-lock.json b/package-lock.json index 7c56df82..01033cf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "Stylus", - "version": "1.5.20", + "version": "1.5.22", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "Stylus", - "version": "1.5.20", + "version": "1.5.22", "license": "GPL-3.0-only", "dependencies": { - "codemirror": "5.62.3", + "codemirror": "5.63.1", "db-to-cloud": "^0.6.0", "jsonlint": "^1.6.3", "less-bundle": "github:openstyles/less-bundle#v0.1.0", @@ -2365,9 +2365,9 @@ } }, "node_modules/codemirror": { - "version": "5.62.3", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.3.tgz", - "integrity": "sha512-zZAyOfN8TU67ngqrxhOgtkSAGV9jSpN1snbl8elPtnh9Z5A11daR405+dhLzLnuXrwX0WCShWlybxPN3QC/9Pg==" + "version": "5.63.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.63.1.tgz", + "integrity": "sha512-baivaNZreZOGh1/tYyTvCupC9NeWk7qlZeGUDi4nFKj/J0JU8FYKZND4QqLw70P7HOttlCt4JJAOj9GoIhHEkA==" }, "node_modules/collection-visit": { "version": "1.0.0", @@ -13938,9 +13938,9 @@ } }, "codemirror": { - "version": "5.62.3", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.3.tgz", - "integrity": "sha512-zZAyOfN8TU67ngqrxhOgtkSAGV9jSpN1snbl8elPtnh9Z5A11daR405+dhLzLnuXrwX0WCShWlybxPN3QC/9Pg==" + "version": "5.63.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.63.1.tgz", + "integrity": "sha512-baivaNZreZOGh1/tYyTvCupC9NeWk7qlZeGUDi4nFKj/J0JU8FYKZND4QqLw70P7HOttlCt4JJAOj9GoIhHEkA==" }, "collection-visit": { "version": "1.0.0", diff --git a/package.json b/package.json index 3a0db08b..8c5016db 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "codemirror": "WARNING! Always use an exact version and test it for a while before releasing" }, "dependencies": { - "codemirror": "5.62.3", + "codemirror": "5.63.1", "db-to-cloud": "^0.6.0", "jsonlint": "^1.6.3", "less-bundle": "github:openstyles/less-bundle#v0.1.0", diff --git a/vendor/codemirror/README.md b/vendor/codemirror/README.md index 17ff971c..e1f3820d 100644 --- a/vendor/codemirror/README.md +++ b/vendor/codemirror/README.md @@ -1,4 +1,4 @@ -## codemirror v5.62.3 +## codemirror v5.63.1 Following files are copied from npm (node_modules): @@ -27,6 +27,7 @@ Following files are copied from npm (node_modules): * keymap\emacs.js * keymap\sublime.js * keymap\vim.js +* lib\#codemirror.js# * lib\codemirror.css * lib\codemirror.js * mode\css diff --git a/vendor/codemirror/keymap/emacs.js b/vendor/codemirror/keymap/emacs.js index 84744e40..9e7ae60f 100644 --- a/vendor/codemirror/keymap/emacs.js +++ b/vendor/codemirror/keymap/emacs.js @@ -330,9 +330,9 @@ cmds.previousLine = move(byLine, -1); - cmds.scrollDownCommand = move(byPage, 1); + cmds.scrollDownCommand = move(byPage, -1); - cmds.scrollUpCommand = move(byPage, -1); + cmds.scrollUpCommand = move(byPage, 1); cmds.backwardParagraph = move(byParagraph, -1); @@ -480,8 +480,8 @@ "Home": "goLineStart", "Alt-V": "scrollDownCommand", "Ctrl-V": "scrollUpCommand", - "PageUp": "scrollUpCommand", - "PageDown": "scrollDownCommand", + "PageUp": "scrollDownCommand", + "PageDown": "scrollUpCommand", "Ctrl-Up": "backwardParagraph", "Ctrl-Down": "forwardParagraph", "Alt-{": "backwardParagraph", diff --git a/vendor/codemirror/keymap/vim.js b/vendor/codemirror/keymap/vim.js index c5210c9c..ee699549 100644 --- a/vendor/codemirror/keymap/vim.js +++ b/vendor/codemirror/keymap/vim.js @@ -951,7 +951,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; } @@ -1311,6 +1316,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); diff --git a/vendor/codemirror/lib/codemirror.js b/vendor/codemirror/lib/codemirror.js index a310c608..d2e5bcc5 100644 --- a/vendor/codemirror/lib/codemirror.js +++ b/vendor/codemirror/lib/codemirror.js @@ -3174,7 +3174,9 @@ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { var charPos = charCoords(cm, head, "div", null, null); - cursor.style.width = Math.max(0, charPos.right - charPos.left) + "px"; + if (charPos.right - charPos.left > 0) { + cursor.style.width = (charPos.right - charPos.left) + "px"; + } } if (pos.other) { @@ -3349,10 +3351,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; @@ -3367,6 +3373,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++) @@ -3381,6 +3388,7 @@ } } } + if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; } } // Read and store the height of line widgets associated with the @@ -4492,6 +4500,12 @@ function onScrollWheel(cm, e) { var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + var pixelsPerUnit = wheelPixelsPerUnit; + if (event.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 @@ -4520,10 +4534,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 @@ -4536,15 +4550,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; @@ -8985,9 +8999,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; }); } @@ -9816,7 +9832,7 @@ addLegacyProps(CodeMirror); - CodeMirror.version = "5.62.3"; + CodeMirror.version = "5.63.1"; return CodeMirror; diff --git a/vendor/codemirror/theme/solarized.css b/vendor/codemirror/theme/solarized.css index 9c6b1265..e978fec9 100644 --- a/vendor/codemirror/theme/solarized.css +++ b/vendor/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 { @@ -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 */