From ab69b6db5022d2e6be1f5225e07c413d255879da Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 28 Mar 2017 21:39:24 +0000 Subject: [PATCH] do not open console if find results tab is not there --- plugins/c9.ide.find.infiles/findinfiles.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/c9.ide.find.infiles/findinfiles.js b/plugins/c9.ide.find.infiles/findinfiles.js index 90ce4e44..6b70a167 100644 --- a/plugins/c9.ide.find.infiles/findinfiles.js +++ b/plugins/c9.ide.find.infiles/findinfiles.js @@ -520,16 +520,10 @@ define(function(require, exports, module) { if (cb && typeof cb != "function") cb = undefined; // called from libsearch options = options || getOptions(); - - // Open Console - if (chkSFConsole.checked) - c9console.show(); makeSearchResultsPanel(function(err, tab) { - if (err) { - c9console.error("Error creating search panel"); - return; - } + if (err) + return console.error("Error creating search panel"); var session = tab.document.getSession(); var acesession = session.session; @@ -822,13 +816,12 @@ define(function(require, exports, module) { return /.*/.exec(str)[0]; } - var searchPanel = {}; function makeSearchResultsPanel(callback) { - var tab = searchPanel[chkSFConsole.checked]; + var tab = tabs.findTab("/.c9/searchresults"); - if (!tab || !tab.loaded) { + if (!tab) { var root = chkSFConsole.checked ? c9console : tabs; - searchPanel[chkSFConsole.checked] = root.open({ + root.open({ path: "/.c9/searchresults", // This allows the tab to be saved focus: true, document: {