highlightActiveLine() for only on codeblock

I am having some problems with getting highlightActiveLine() to work how I need it and was hoping that you could help.

My team is working on a vscode extension, in which we use prose/codemirror, and instead of having a single codemirror block, we have many of them, with, for example, markdown blocks in between, as can be seen below:

Because of this, when using highlightActiveLine() we get an active line highlight for each of the codeblocks (black lines in the image above).

Is there any way that we could get highlightActiveLine() to work only on the selected codeblock or the last selected codeblock?

Would it be a better to make our own extension or try to make highlightActiveLine() work?

We though of trying to give different styles to selected vs. unselected codeblocks, making the later transparent, but didn’t manage to get this to work just yet.

This theme should be able to do this:

      "&:not(.cm-focused) .cm-activeLine": {
        backgroundColor: "transparent"
1 Like

Great, this worked, thank you!