From 8ad52f17568b0a769da9e8c319a876cf7befd2d2 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 5 Mar 2018 18:30:32 +0400 Subject: [PATCH 1/2] fix issue with scroll position being reset on tab switch --- plugins/c9.ide.ui/lib_apf.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/c9.ide.ui/lib_apf.js b/plugins/c9.ide.ui/lib_apf.js index a21f623d..aab4125d 100644 --- a/plugins/c9.ide.ui/lib_apf.js +++ b/plugins/c9.ide.ui/lib_apf.js @@ -5541,9 +5541,12 @@ apf.AmlNode = function(){ nextNode = nextNode.nextSibling; } - amlNode.$pHtmlNode.insertBefore(amlNode.$altExt || amlNode.$ext, - nextNode && (nextNode.$altExt || nextNode.$ext) || null); + var htmlNode = amlNode.$altExt || amlNode.$ext; + var nextHtmlNode = nextNode && (nextNode.$altExt || nextNode.$ext) || null; + if (htmlNode.parentNode != amlNode.$pHtmlNode || amlNode.nextSibling != nextHtmlNode) { + amlNode.$pHtmlNode.insertBefore(htmlNode, nextHtmlNode); + } } //Signal node and all it's ancestors From 8605bafc84a7e9d10a862fe1550ae8bea7ede3da Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 5 Mar 2018 20:35:15 +0400 Subject: [PATCH 2/2] fix scrolltop being changed after moving the tab between panes --- plugins/c9.ide.editors/editor.js | 1 + plugins/c9.ide.editors/texteditor.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/c9.ide.editors/editor.js b/plugins/c9.ide.editors/editor.js index e063f26b..ea239e6d 100644 --- a/plugins/c9.ide.editors/editor.js +++ b/plugins/c9.ide.editors/editor.js @@ -30,6 +30,7 @@ define(function(require, module, exports) { // Old Editor var lastEditor = doc.editor; if (lastEditor && lastEditor != plugin) { + doc.getState(); lastEditor.unloadDocument(doc, { toEditor: plugin, fromEditor: lastEditor diff --git a/plugins/c9.ide.editors/texteditor.js b/plugins/c9.ide.editors/texteditor.js index bd402ea1..ce92ecda 100644 --- a/plugins/c9.ide.editors/texteditor.js +++ b/plugins/c9.ide.editors/texteditor.js @@ -49,13 +49,13 @@ define(function(require, exports, module) { // Value doc.on("getValue", function get(e) { - return currentDocument == doc + return currentDocument == doc && editor ? editor.value : e.value; }, session); doc.on("setValue", function set(e) { - if (currentDocument == doc) + if (currentDocument == doc && editor) editor.value = e.value || ""; }, session);