diff --git a/_includes/vhv-scripts/utility-ace.js b/_includes/vhv-scripts/utility-ace.js index d685175..40af23b 100644 --- a/_includes/vhv-scripts/utility-ace.js +++ b/_includes/vhv-scripts/utility-ace.js @@ -221,3 +221,40 @@ function humdrumDataNoteIntoView(event) { } + + +////////////////////////////// +// +// gotoLineFieldInEditor -- +// + +function gotoLineFieldInEditor(row, field) { + let linecontent = EDITOR.session.getLine(row-1); + + let col = 0; + if (field > 1) { + let tabcount = 0; + for (let i=0; i 0) && (linecontent[i-1] != '\t')) { + tabcount++; + } + } + if (tabcount == field - 1) { + break; + } + } + } + + EDITOR.gotoLine(row, col); + + // 0.5 = center the cursor vertically: + EDITOR.renderer.scrollCursorIntoView({row: row-1, column: col}, 0.5); + centerCursorHorizontallyInEditor(); + +} + + + + diff --git a/_includes/vhv-scripts/utility-svg.js b/_includes/vhv-scripts/utility-svg.js index ec6f249..6f2f312 100644 --- a/_includes/vhv-scripts/utility-svg.js +++ b/_includes/vhv-scripts/utility-svg.js @@ -930,5 +930,3 @@ function highlightIdInEditor(id, source) { } - -