MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / buildCollapsedSpan

Function buildCollapsedSpan

lib/web/CodeMirror/src/line/line_data.js:232–246  ·  view source on GitHub ↗
(builder, size, marker, ignoreWidget)

Source from the content-addressed store, hash-verified

230}
231
232function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
233 let widget = !ignoreWidget && marker.widgetNode
234 if (widget) builder.map.push(builder.pos, builder.pos + size, widget)
235 if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
236 if (!widget)
237 widget = builder.content.appendChild(document.createElement("span"))
238 widget.setAttribute("cm-marker", marker.id)
239 }
240 if (widget) {
241 builder.cm.display.input.setUneditable(widget)
242 builder.content.appendChild(widget)
243 }
244 builder.pos += size
245 builder.trailingSpace = false
246}
247
248// Outputs a number of spans to make up a line, taking highlighting
249// and marked text into account.

Callers 1

insertLineContentFunction · 0.70

Calls 2

pushMethod · 0.45
setUneditableMethod · 0.45

Tested by

no test coverage detected