MCPcopy Create free account
hub / github.com/TruthHun/BookStack / selectName

Function selectName

static/editor.md/lib/codemirror/addon/tern/tern.js:462–477  ·  view source on GitHub ↗
(ts, cm)

Source from the content-addressed store, hash-verified

460 }
461
462 function selectName(ts, cm) {
463 var name = findDoc(ts, cm.doc).name;
464 ts.request(cm, {type: "refs"}, function(error, data) {
465 if (error) return showError(ts, cm, error);
466 var ranges = [], cur = 0;
467 for (var i = 0; i < data.refs.length; i++) {
468 var ref = data.refs[i];
469 if (ref.file == name) {
470 ranges.push({anchor: ref.start, head: ref.end});
471 if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0)
472 cur = ranges.length - 1;
473 }
474 }
475 cm.setSelections(ranges, cur);
476 });
477 }
478
479 var nextChangeOrig = 0;
480 function applyChanges(ts, changes) {

Callers 1

tern.jsFile · 0.85

Calls 2

findDocFunction · 0.85
showErrorFunction · 0.70

Tested by

no test coverage detected