private generate()

in src/lib/CodeMirror/indentationMarkers.ts [501:530]


	private generate(state: EditorState) {
		const builder = new RangeSetBuilder<Decoration>();

		const lines = getVisibleLines(this.view, state);
		const map = new IndentationMap(lines, state, this.unitWidth);
		const { hideFirstIndent } = state.facet(indentationMarkerConfig);

		for (const line of lines) {
			const entry = map.get(line.number);

			if (!entry?.level) {
				continue;
			}

			const backgrounds = makeBackgroundCSS(entry, this.unitWidth, hideFirstIndent);

			builder.add(
				line.from,
				line.from,
				Decoration.line({
					class: 'cm-indent-markers',
					attributes: {
						style: `--indent-markers: ${backgrounds}`
					}
				})
			);
		}

		this.decorations = builder.finish();
	}