Can pass charNo (int) and noFocus (bool)

This commit is contained in:
Matt Pass
2019-09-21 21:33:55 +01:00
committed by GitHub
parent 5b529ee542
commit 7243a21c61

View File

@@ -1102,10 +1102,11 @@ var ICEcoder = {
},
// Go to a specific line number
goToLine: function(lineNo) {
goToLine: function(lineNo, charNo, noFocus) {
var cM, cMdiff, thisCM;
lineNo = lineNo ? lineNo-1 : top.get('goToLineNo').value-1;
charNo = charNo ? charNo : 0;
cM = ICEcoder.getcMInstance();
cMdiff = ICEcoder.getcMdiffInstance();
@@ -1127,10 +1128,12 @@ var ICEcoder = {
}
},10);
thisCM.setCursor(lineNo);
top.ICEcoder.focus();
// Also do this after a 0ms tickover incase DOM wasn't ready
setTimeout(function(){top.ICEcoder.focus();},0);
thisCM.setCursor(lineNo, charNo);
if (!noFocus) {
top.ICEcoder.focus();
// Also do this after a 0ms tickover incase DOM wasn't ready
setTimeout(function(){top.ICEcoder.focus();},0);
}
return false;
},