MCPcopy Create free account
hub / github.com/breck7/scroll / buildCollapsedSpan

Function buildCollapsedSpan

external/.scrollLibs.js:3042–3059  ·  view source on GitHub ↗
(builder, size, marker, ignoreWidget)

Source from the content-addressed store, hash-verified

3040 }
3041
3042 function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
3043 var widget = !ignoreWidget && marker.widgetNode
3044 if (widget) {
3045 builder.map.push(builder.pos, builder.pos + size, widget)
3046 }
3047 if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
3048 if (!widget) {
3049 widget = builder.content.appendChild(document.createElement("span"))
3050 }
3051 widget.setAttribute("cm-marker", marker.id)
3052 }
3053 if (widget) {
3054 builder.cm.display.input.setUneditable(widget)
3055 builder.content.appendChild(widget)
3056 }
3057 builder.pos += size
3058 builder.trailingSpace = false
3059 }
3060
3061 // Outputs a number of spans to make up a line, taking highlighting
3062 // and marked text into account.

Callers 1

insertLineContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected