Hilight selection of the block in editor view is not visible

Steps to reproduce

  1. Create a code block, for example:
echo "Hello world"

Expected result

Should hilight the code block like in headings etc, like this:


Actual result

No hilight, the rectangle bit is selected and I can copy it but it gets no decoration:


As a CSS developer myself I tried to edit obsidian.css and add styles for ::selection but it has no effect. I saw Obsidian uses CodeMirror and tested .CodeMirror-selected next but it only affects on headings etc… in code blocks it has no effect.


  • Operating system: Tested on Windows 10 Pro and macOS Big Sur (11.4)
  • Obsidian version: 0.12.10

Please resubmit this bug report and make sure that: 1) you follow the bug report template, 2) you use the default theme (no css) and 3) there are no third-party plugins enabled (You can use the help vault for 2 and 3).