Change icon for gutter (code folding)

I’m trying to change the icon for code folding but it doesn’t remove the default icon.

Here’s my code:

const foldConfig = foldGutter({
    markerDOM: open => {
        let icon = document.createElement('span');
        icon.className = open ? 'bi bi-plus-square' : 'bi bi-dash-square';

        return icon;
    },
});

and here are the results


I suspect you are including foldGutter twice in your configuration (probably once through basicSetup and once through your own custom instance).

Yes here is my setup. Is there a way to override the code folding config and remove the default icon?

const foldConfig = foldGutter({
    markerDOM: open => {
        let icon = document.createElement('span');
        icon.className = open ? 'bi bi-plus-square' : 'bi bi-dash-square';

        return icon;
    },
});

let state = EditorState.create({
    extensions: [
        basicSetup,
        languageCompartment.of(python()),
        foldingCompartment.of(foldConfig)
    ],
});

You’ll have to stop using the basic setup (by inlining it into your project).