10

I'm applying a background color to code blocks in org-mode, as shown in this line from my colortheme:

'(org-block ((t (:background "#F5F5F5" :family "Source Code Pro" :height 140))))

expanded item with code block

When I collapse an item that contains a code block, the code block's background color extends from the end of the item's heading to the edge of the window, which I did not expect -- I expected collapsing the item would hide any evidence of the contained code-block.

collapsed item with code block

Is there any way to prevent the code block background from "bleeding through" like this?

ivan
  • 1,928
  • 10
  • 20

2 Answers2

1

I found that adding a blank line past the source block prevents the bleeding.

p_wiersig
  • 1,051
  • 9
  • 15
  • Confirmed. But is this a bug or by design? It seems header formatting should be independent of its collapse/expand state (except for the presence of ellipses to indicate collapsed content.) – Snelephant Feb 02 '18 at 21:19
  • Correction: This issue appears be unique to specific themes. For example, leuven theme does not exhibit the above behavior. – Snelephant Feb 02 '18 at 21:45
  • Has this issue been resolved? I am still observing it on my system – GenaU Jul 19 '21 at 02:20
0

You found a known bug tracked here:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52587