From 30cd3d2961a8a5f8e3513e87ffc07d26c702b83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Wed, 2 Feb 2022 11:25:18 +0100 Subject: [PATCH] Merge pull request #6551 from overleaf/bg-remove-unused-flag [web] remove unused keepEditorContents flag GitOrigin-RevId: 9c20469e9200ee9aad19fdd0d1567a6eea704741 --- services/web/frontend/js/ide/editor/ShareJsDoc.js | 6 +++--- services/web/frontend/js/vendor/libs/sharejs.js | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/services/web/frontend/js/ide/editor/ShareJsDoc.js b/services/web/frontend/js/ide/editor/ShareJsDoc.js index ef2397ef9b..6de8a00bed 100644 --- a/services/web/frontend/js/ide/editor/ShareJsDoc.js +++ b/services/web/frontend/js/ide/editor/ShareJsDoc.js @@ -355,7 +355,7 @@ export default ShareJsDoc = (function () { attachToAce(ace) { this._attachToEditor('Ace', ace, () => { - this._doc.attach_ace(ace, false, window.maxDocLength) + this._doc.attach_ace(ace, window.maxDocLength) }) } @@ -368,7 +368,7 @@ export default ShareJsDoc = (function () { attachToCM(cm) { this._attachToEditor('CM', cm, () => { - this._doc.attach_cm(cm, false, window.maxDocLength) + this._doc.attach_cm(cm, window.maxDocLength) }) } @@ -381,7 +381,7 @@ export default ShareJsDoc = (function () { attachToCM6(cm6) { this._attachToEditor('CM6', cm6, () => { - cm6.attachShareJs(this._doc, false, window.maxDocLength) + cm6.attachShareJs(this._doc, window.maxDocLength) }) } diff --git a/services/web/frontend/js/vendor/libs/sharejs.js b/services/web/frontend/js/vendor/libs/sharejs.js index 7af70303fd..632cd464f9 100644 --- a/services/web/frontend/js/vendor/libs/sharejs.js +++ b/services/web/frontend/js/vendor/libs/sharejs.js @@ -1467,9 +1467,8 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) { }; // Attach an ace editor to the document. The editor's contents are replaced - // with the document's contents unless keepEditorContents is true. (In which case the document's - // contents are nuked and replaced with the editor's). - window.sharejs.extendDoc('attach_ace', function (editor, keepEditorContents, maxDocLength) { + // with the document's contents. + window.sharejs.extendDoc('attach_ace', function (editor, maxDocLength) { if (!this.provides['text']) { throw new Error('Only text documents can be attached to ace'); } @@ -1622,14 +1621,13 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) { }; // Attach a CodeMirror editor to the document. The editor's contents are replaced - // with the document's contents unless keepEditorContents is true. (In which case - // the document's contents are nuked and replaced with the editor's). + // with the document's contents. // NOTE: When upgrading CM, make sure to check for new special cases of // origin prefixes as documented for `doc.setSelection`. We are using // a custom `origin: 'remote'` which may conflict. // Perma link of the docs at the time of writing this note: // https://web.archive.org/web/20201029163528/https://codemirror.net/doc/manual.html#selection_origin - window.sharejs.extendDoc('attach_cm', function (editor, keepEditorContents, maxDocLength) { + window.sharejs.extendDoc('attach_cm', function (editor, maxDocLength) { if (!this.provides.text) { throw new Error('Only text documents can be attached to CodeMirror2'); }