From a2bfeb4932ca15b43ebd18009c32c23fe5e3cdf4 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Wed, 21 Oct 2015 21:12:27 +0000 Subject: [PATCH] Make merge tool work when switching editors --- package.json | 2 +- plugins/c9.ide.editors/tabmanager.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 179323bd..ab931fb4 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "c9.ide.run.build": "#0598fff697", "c9.ide.run.debug.xdebug": "#61dcbd0180", "c9.ide.save": "#4a4a60a004", - "c9.ide.scm": "#d92bb9aeb5", + "c9.ide.scm": "#a194f3ca85", "c9.ide.terminal.monitor": "#b76f1c9f24", "c9.ide.test": "#ba0ed6e586", "c9.ide.test.mocha": "#f6cc482886", diff --git a/plugins/c9.ide.editors/tabmanager.js b/plugins/c9.ide.editors/tabmanager.js index f387caaa..21cad3e8 100644 --- a/plugins/c9.ide.editors/tabmanager.js +++ b/plugins/c9.ide.editors/tabmanager.js @@ -178,7 +178,7 @@ define(function(require, module, exports) { if (!editors.findEditor(e.value).fileExtensions.length) openEditor(e.value, true, function(){}); else if (focussedTab) - focussedTab.switchEditor(e.value, function(){}); + switchEditor(focussedTab, e.value, function(){}); }); editors.on("menuShow", function(e) { var group, editor = focussedTab && focussedTab.editor; @@ -1405,6 +1405,13 @@ define(function(require, module, exports) { return true; } + function switchEditor(tab, type, callback) { + tab.switchEditor(type, function(){ + emit("switchEditor", { tab: tab }); + callback.apply(this, arguments); + }); + } + /**** Support for state preservation ****/ function pauseTabResize(){ @@ -1956,6 +1963,11 @@ define(function(require, module, exports) { */ clone: clone, + /** + * + */ + switchEditor: switchEditor, + /** * @ignore */