MCPcopy Index your code
hub / github.com/csev/py4e / markTextShared

Function markTextShared

tools/pythonauto/static/codemirror/codemirror.js:4044–4057  ·  view source on GitHub ↗
(doc, from, to, options, type)

Source from the content-addressed store, hash-verified

4042 };
4043
4044 function markTextShared(doc, from, to, options, type) {
4045 options = copyObj(options);
4046 options.shared = false;
4047 var markers = [markText(doc, from, to, options, type)], primary = markers[0];
4048 var widget = options.replacedWith;
4049 linkedDocs(doc, function(doc) {
4050 if (widget) options.replacedWith = widget.cloneNode(true);
4051 markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
4052 for (var i = 0; i < doc.linked.length; ++i)
4053 if (doc.linked[i].isParent) return;
4054 primary = lst(markers);
4055 });
4056 return new SharedTextMarker(markers, primary);
4057 }
4058
4059 // TEXTMARKER SPANS
4060

Callers 1

markTextFunction · 0.70

Calls 6

copyObjFunction · 0.70
markTextFunction · 0.70
linkedDocsFunction · 0.70
clipPosFunction · 0.70
lstFunction · 0.70
cloneNodeMethod · 0.45

Tested by

no test coverage detected