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?

2 Answers 2

1

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

3
  • 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.) Commented Feb 2, 2018 at 21:19
  • Correction: This issue appears be unique to specific themes. For example, leuven theme does not exhibit the above behavior. Commented Feb 2, 2018 at 21:45
  • Has this issue been resolved? I am still observing it on my system Commented Jul 19, 2021 at 2:20
0

You found a known bug tracked here:

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.