diff --git a/lib/ice-coder.js b/lib/ice-coder.js index a4092f9..38f2c47 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -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; },