Skip to content

Commit

Permalink
Commando: Clear cache now clears cache for all scopes - fixes Komodo#…
Browse files Browse the repository at this point in the history
…1018

rn=

(integrated from the KomodoIDE master branch change 66e1bd4221 by Nathan Rijksen <[email protected]>)

Komodo/KomodoIDE@66e1bd4221
  • Loading branch information
Naatan committed May 4, 2018
1 parent 2e379a2 commit db7871e
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/modules/commando/content/sdk/commando.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
resultHeightTimer: null,
lastSearch: 0,
showing: false,
accesskeys: {}
accesskeys: {},
selectedScope: null
};

var elems = {
Expand Down Expand Up @@ -553,7 +554,6 @@
if ( ! ("_scope" in scopeElem.element().selectedItem))
{
log.debug("Scope selection is not an actual scope, reverting active scope menuitem");
log.debug(local.selectedScope);

if (local.selectedScope)
scopeElem.element().selectedItem = scopeElem.find("#scope-"+local.selectedScope).element();
Expand Down Expand Up @@ -1897,9 +1897,10 @@
return elem('scope').element().selectedItem._scope;
}

this.getScopeHandler = function()
this.getScopeHandler = function(scope)
{
var scope = c.getScope();
if ( ! scope)
scope = c.getScope();
return require(scope.handler);
}

Expand All @@ -1913,13 +1914,14 @@
return local.panelClone.clone();
}

this.execScopeHandler = function(method, args)
this.execScopeHandler = function(method, args, scope = null)
{
var scope = c.getScope().handler;
if ( ! scope)
scope = c.getScope();
log.debug("Executing scope handler: " + method + " on " + scope);

var result = false;
var scopeHandler = c.getScopeHandler();
var scopeHandler = c.getScopeHandler(scope);
if (method in scopeHandler)
{
log.debug("Executing " + method + " on scope");
Expand All @@ -1931,12 +1933,12 @@
log.debug(method + " not found in scope, skipping");
}

if ((scope in local.handlers) && (method in local.handlers[scope]))
if ((scope.handler in local.handlers) && (method in local.handlers[scope.handler]))
{
for (let id in local.handlers[scope][method])
for (let id in local.handlers[scope.handler][method])
{
log.debug("Executing Custom Handler: " + id);
local.handlers[scope][method][id].apply(null, args);
local.handlers[scope.handler][method][id].apply(null, args);
}
}

Expand Down Expand Up @@ -2094,7 +2096,11 @@

this.clearCache = function()
{
c.execScopeHandler("clearCache");
var scopes = c.getRegisteredScopes();
for (let id in scopes)
{
c.execScopeHandler("clearCache", null, scopes[id]);
}
c.tip("Cache Cleared");

c.reSearch();
Expand Down

0 comments on commit db7871e

Please sign in to comment.