snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

bug: Mermaind rendering in Markdown will not fold

Open Krystian-KF opened this issue 1 week ago • 0 comments

Did you check docs and existing issues?

  • [x] I have read all the snacks.nvim docs
  • [x] I have updated the plugin to the latest version before submitting this issue
  • [x] I have searched the existing issues of snacks.nvim
  • [x] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-1775+g4a2a54f993

Operating system/version

Fedora 41

Describe the bug

Mermaid preview will persist even when the code block or a heading are folded and the source is not visible anymore. There is no issue with previews for the images itself or latex inline / part of the codeblock.

See the video for the better explanation.

https://github.com/user-attachments/assets/92f4db15-6ff6-4164-b34f-146f921a9936

There is another small issue visible in the video when unfolding the heading containing an image for the first time,. I have not played with it enough yet though. Let me know what you think, please as If it is needed I will log another bug report.

Steps To Reproduce

  1. Enable inline preview.
  2. Open example.md
  3. Play with folds.

Expected Behavior

Preview to disappear when folded.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/snacks.nvim", opts = {} },
    -- add any other plugins here
  },
})

Krystian-KF avatar Feb 18 '25 07:02 Krystian-KF