Skip to content

Commit 9c2827f

Browse files
save file
1 parent c362ec4 commit 9c2827f

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

‎utils/editors/html/code-explorer/v1.0/code-explorer-v1.0.html‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
$(node,'.name').textContent = o.name;
267267
$(node,'.args').textContent = o.args;
268268

269-
node.onclick = e=>editor.gotoline(o.line,o.indent);
269+
node.onclick = e=>editor.gotoline(o.line,o.col);
270270

271271
view.append(node);
272272

@@ -338,7 +338,10 @@
338338
$(node,'.class').remove();
339339
}
340340

341-
node.onclick = e=>editor.gotoline(o.line,o.indent);
341+
if(o.name=='script'){
342+
}
343+
344+
node.onclick = e=>editor.gotoline(o.line,o.col);
342345

343346
view.append(node);
344347

@@ -457,8 +460,9 @@
457460

458461
var args = parse.fn.args(txt,i1);
459462
var indent = parse.indent(txt,i1);
463+
var col = colno(txt,i1);
460464

461-
return {index:i1,name,args,indent};
465+
return {index:i1,col,name,args,indent};
462466

463467
}//type1
464468

@@ -573,6 +577,15 @@
573577
}//line
574578

575579

580+
function colno(txt,index){
581+
582+
var i1 = txt.lastIndexOf('\n',index);
583+
vaar colno = index-i1;
584+
return colno;
585+
586+
}//colno
587+
588+
576589
function ws(txt,i1){
577590

578591
var regex = /\s*/y;
@@ -631,11 +644,13 @@
631644
}//for
632645

633646
var line = lineno(txt,index);
647+
var col = colno(txt,index);
634648
var indent = parse.indent(txt,index);
635649

636650
var o = {
637651
index,
638652
line,
653+
col,
639654
indent,
640655
name,
641656
attrs

0 commit comments

Comments
 (0)