mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-09 10:06:46 +01:00
Closure on vars, pass to anon functions
This commit is contained in:
@@ -700,8 +700,8 @@ var ICEcoder = {
|
||||
var word = (cM.getRange(cM.findWordAt(cM.getCursor()).anchor, cM.findWordAt(cM.getCursor()).head));
|
||||
|
||||
// Get result and number of results for word in functions and classes from index JSON object list
|
||||
result = null;
|
||||
numResults = 0;
|
||||
var result = null;
|
||||
var numResults = 0;
|
||||
var filePath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
var filePathExt = filePath.substr(filePath.lastIndexOf(".")+1);
|
||||
for(i in top.ICEcoder.indexData.functions[filePathExt]) {
|
||||
@@ -720,16 +720,16 @@ var ICEcoder = {
|
||||
// If we have a single result and the cursor isn't already on the definition of it we can jump to where it's defined
|
||||
if (numResults === 1 && [null,"def"].indexOf(cM.getTokenTypeAt(cM.getCursor())) === -1) {
|
||||
top.ICEcoder.openFile(result.filePath.replace(top.docRoot,""));
|
||||
top.ICEcoder.goFindAfterOpenInt = setInterval(function(){
|
||||
top.ICEcoder.goFindAfterOpenInt = setInterval(function(result){
|
||||
if (top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1] == result.filePath.replace(top.docRoot,"") && !top.ICEcoder.loadingFile) {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
setTimeout(function() {
|
||||
setTimeout(function(result) {
|
||||
top.ICEcoder.goToLine(result.range.from.line+1);
|
||||
cM.setSelection({line: result.range.from.line, ch: result.range.from.ch}, {line: result.range.to.line, ch: result.range.to.ch});
|
||||
},20);
|
||||
},20,result);
|
||||
clearInterval(top.ICEcoder.goFindAfterOpenInt);
|
||||
}
|
||||
},20);
|
||||
},20,result);
|
||||
}
|
||||
|
||||
top.ICEcoder.mouseDownInCM = "editor";
|
||||
|
||||
Reference in New Issue
Block a user