diff --git a/src/public/libraries/codemirror/addon/edit/matchbrackets.js b/src/public/libraries/codemirror/addon/edit/matchbrackets.js index c9851bda3..c918c3f99 100644 --- a/src/public/libraries/codemirror/addon/edit/matchbrackets.js +++ b/src/public/libraries/codemirror/addon/edit/matchbrackets.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/src/public/libraries/codemirror/addon/edit/matchtags.js b/src/public/libraries/codemirror/addon/edit/matchtags.js index fb1911a8d..2203d9390 100644 --- a/src/public/libraries/codemirror/addon/edit/matchtags.js +++ b/src/public/libraries/codemirror/addon/edit/matchtags.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/src/public/libraries/codemirror/addon/fold/xml-fold.js b/src/public/libraries/codemirror/addon/fold/xml-fold.js index 867ecb5cb..13bc3838b 100644 --- a/src/public/libraries/codemirror/addon/fold/xml-fold.js +++ b/src/public/libraries/codemirror/addon/fold/xml-fold.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/src/public/libraries/codemirror/addon/mode/loadmode.js b/src/public/libraries/codemirror/addon/mode/loadmode.js index 10117ec22..4ce716a01 100644 --- a/src/public/libraries/codemirror/addon/mode/loadmode.js +++ b/src/public/libraries/codemirror/addon/mode/loadmode.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/src/public/libraries/codemirror/addon/search/match-highlighter.js b/src/public/libraries/codemirror/addon/search/match-highlighter.js index 260cdeb2a..b344ac79e 100644 --- a/src/public/libraries/codemirror/addon/search/match-highlighter.js +++ b/src/public/libraries/codemirror/addon/search/match-highlighter.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE // Highlighting text that matches the selection // diff --git a/src/public/libraries/codemirror/codemirror.js b/src/public/libraries/codemirror/codemirror.js index 68a109bf0..e178478d2 100644 --- a/src/public/libraries/codemirror/codemirror.js +++ b/src/public/libraries/codemirror/codemirror.js @@ -1,7 +1,7 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE -// This is CodeMirror (http://codemirror.net), a code editor +// This is CodeMirror (https://codemirror.net), a code editor // implemented in JavaScript on top of the browser's DOM. // // You can find some technical background for some of the code below @@ -1820,7 +1820,7 @@ function buildLineContent(cm, lineView) { var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, col: 0, pos: 0, cm: cm, trailingSpace: false, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")} + splitSpaces: cm.getOption("lineWrapping")} lineView.measure = {} // Iterate over the logical lines that make up this visual line. @@ -1941,6 +1941,8 @@ function buildToken(builder, text, style, startStyle, endStyle, title, css) { builder.content.appendChild(content) } +// Change some spaces to NBSP to prevent the browser from collapsing +// trailing spaces at the end of a line when rendering text (issue #1362). function splitSpaces(text, trailingBefore) { if (text.length > 1 && !/ /.test(text)) { return text } var spaceBefore = trailingBefore, result = "" @@ -7242,8 +7244,9 @@ function onMouseDown(e) { } return } - if (clickInGutter(cm, e)) { return } - var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single" + var button = e_button(e) + if (button == 3 && captureRightClick ? contextMenuInGutter(cm, e) : clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), repeat = pos ? clickRepeat(pos, button) : "single" window.focus() // #3261: make sure, that we're not starting a second selection @@ -7722,6 +7725,7 @@ function defineOptions(CodeMirror) { option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }) option("autofocus", null) option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true) + option("phrases", null) } function guttersChanged(cm) { @@ -8560,6 +8564,11 @@ function addEditorMethods(CodeMirror) { return old }), + phrase: function(phraseText) { + var phrases = this.options.phrases + return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText + }, + getInputField: function(){return this.display.input.getField()}, getWrapperElement: function(){return this.display.wrapper}, getScrollerElement: function(){return this.display.scroller}, @@ -9677,7 +9686,7 @@ CodeMirror.fromTextArea = fromTextArea addLegacyProps(CodeMirror) -CodeMirror.version = "5.39.2" +CodeMirror.version = "5.40.2" return CodeMirror; diff --git a/src/public/libraries/codemirror/mode/apl/apl.js b/src/public/libraries/codemirror/mode/apl/apl.js index caafe4e91..b1955f6c9 100644 --- a/src/public/libraries/codemirror/mode/apl/apl.js +++ b/src/public/libraries/codemirror/mode/apl/apl.js @@ -1,5 +1,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE +// Distributed under an MIT license: https://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS diff --git a/src/public/libraries/codemirror/mode/apl/index.html b/src/public/libraries/codemirror/mode/apl/index.html index 53dda6b58..56ab02ffb 100644 --- a/src/public/libraries/codemirror/mode/apl/index.html +++ b/src/public/libraries/codemirror/mode/apl/index.html @@ -12,7 +12,7 @@ .CodeMirror { border: 2px inset #dee; }