Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 7243a21

Browse files
authored
Can pass charNo (int) and noFocus (bool)
1 parent 5b529ee commit 7243a21

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/ice-coder.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,10 +1102,11 @@ var ICEcoder = {
11021102
},
11031103

11041104
// Go to a specific line number
1105-
goToLine: function(lineNo) {
1105+
goToLine: function(lineNo, charNo, noFocus) {
11061106
var cM, cMdiff, thisCM;
11071107

11081108
lineNo = lineNo ? lineNo-1 : top.get('goToLineNo').value-1;
1109+
charNo = charNo ? charNo : 0;
11091110

11101111
cM = ICEcoder.getcMInstance();
11111112
cMdiff = ICEcoder.getcMdiffInstance();
@@ -1127,10 +1128,12 @@ var ICEcoder = {
11271128
}
11281129
},10);
11291130

1130-
thisCM.setCursor(lineNo);
1131-
top.ICEcoder.focus();
1132-
// Also do this after a 0ms tickover incase DOM wasn't ready
1133-
setTimeout(function(){top.ICEcoder.focus();},0);
1131+
thisCM.setCursor(lineNo, charNo);
1132+
if (!noFocus) {
1133+
top.ICEcoder.focus();
1134+
// Also do this after a 0ms tickover incase DOM wasn't ready
1135+
setTimeout(function(){top.ICEcoder.focus();},0);
1136+
}
11341137
return false;
11351138
},
11361139

0 commit comments

Comments
 (0)