-
Fix implemented with two changes:
-
kitty-gfx--overlay-screen-pos: Added(not (invisible-p pos))check. When org folds a heading, the text gets aninvisibleproperty. Previously,pos-visible-in-window-palone didn't detect this — it only checks the window scroll range, not text invisibility. Now overlays in invisible regions returnnilfrom screen-pos, causing the refresh cycle to delete their terminal placements. -
kitty-gfx--on-org-cycle: New function hooked intoorg-cycle-hook. When org cycles heading visibility, this clears the position cache on all overlays and schedules a refresh, ensuring images are immediately hidden/shown rather than waiting for the next post-command-hook.
Byte-compiles and load-tests clean. Needs manual testing in a Kitty-compatible terminal.
-
-
Previous Value Current Value Open
In Review
-
Verified working by user. Heading collapse now correctly hides images, expand shows them again.
Root cause was twofold:
invisible-pwas too broad (caughtorg-linkbracket hiding) — replaced withkitty-gfx--in-folded-region-pusingorg-fold-folded-pkitty-gfx--on-org-cyclecleared the position cache (last-row→ nil) before the refresh ran, causing the refresh's else branch(when last-row ...)to skip placement deletion. Fixed by explicitly deleting all current-buffer placements in the org-cycle handler before clearing cache.
-
Fixed in b239825. Images now hide when org headings are collapsed and reappear when expanded. Uses org-fold-folded-p for org 9.6+ with legacy fallback. User verified working.
-
Previous Value Current Value In Review
Closed
| Type |
Bug
|
| Priority |
Critical
|
| Assignees |
Not assigned
|
Reported by: pathemata (Reddit)
Image overlays remain visible when org headings are folded/collapsed. The overlays should be hidden (placement deleted) when their containing heading is collapsed, and re-placed when the heading is expanded.
This likely requires hooking into org's visibility change mechanism (
org-cycle-hookororg-after-todo-state-change-hook) to detect when a heading's body becomes invisible, and then deleting the terminal placement for any overlays in the hidden region.Steps to reproduce:
C-c C-x C-vto display inline imagesTABExpected: Images disappear when heading is collapsed, reappear when expanded.