MCPcopy Create free account
hub / github.com/sql-js/sql.js / markTextShared

Function markTextShared

GUI/codemirror/lib/codemirror.js:5095–5108  ·  view source on GitHub ↗
(doc, from, to, options, type)

Source from the content-addressed store, hash-verified

5093 };
5094
5095 function markTextShared(doc, from, to, options, type) {
5096 options = copyObj(options);
5097 options.shared = false;
5098 var markers = [markText(doc, from, to, options, type)], primary = markers[0];
5099 var widget = options.widgetNode;
5100 linkedDocs(doc, function(doc) {
5101 if (widget) options.widgetNode = widget.cloneNode(true);
5102 markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
5103 for (var i = 0; i < doc.linked.length; ++i)
5104 if (doc.linked[i].isParent) return;
5105 primary = lst(markers);
5106 });
5107 return new SharedTextMarker(markers, primary);
5108 }
5109
5110 function findSharedMarkers(doc) {
5111 return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())),

Callers 1

markTextFunction · 0.85

Calls 5

copyObjFunction · 0.85
markTextFunction · 0.85
linkedDocsFunction · 0.85
clipPosFunction · 0.85
lstFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…