8000 Folds render weirdly and inconsistently with render-markdown.nvim · Issue #301 · kevinhwang91/nvim-ufo · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Folds render weirdly and inconsistently with render-markdown.nvim #301

Open

Description

@okuuva

Neovim version (nvim -v | head -n1)

NVIM v0.11.0

Operating system/version

macOS 15.4.1

How to reproduce the issue

A test file:
cat ufo-render-markdown-test.md

- [ ] demo without a link
    - test

- [ ] demo with a [link](https://github.com/)
    - test

- test
    - test
    - test
        - test

Using https://github.com/neovim/neovim/blob/release-0.11/contrib/minimal.lua as template for mini.lua.
cat mini.lua

for name, url in pairs({
  promise_async = "https://github.com/kevinhwang91/promise-async",
  ufo = "https://github.com/kevinhwang91/nvim-ufo",
  render_markdown = "https://github.com/MeanderingProgrammer/render-markdown.nvim",
}) do
  local install_path = vim.fn.fnamemodify("nvim_issue/" .. name, ":p")
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
  end
  vim.opt.runtimepath:append(install_path)
end

vim.o.foldcolumn = "1"
vim.o.foldlevel = 99
vim.o.foldlevelstart = -1
vim.o.foldenable = true
vim.o.foldtext = ""  -- to demonstrate that render works with empty foldtext

local ufo = require("ufo")
ufo.setup()
vim.keymap.set("n", "zR", ufo.openAllFolds)
vim.keymap.set("n", "zM", ufo.closeAllFolds)

require("render-markdown").setup({})

nvim --clean -u mini.lua render-markdown-ufo-test.md

Here's how the file looks like without anything folded:
Image

Fold things and see changes in e.g. checkbox rendering.

Expected behavior

Rendered folds should look similar to what they look like when vim.o.foldtext = "" and ufo disabled:

Image

Actual behavior

Folds render inconsistently. Checkbox folds never render correctly, while list items sometimes render correctly and other times not:

Image Image

Activity

  1. added
    bug
    on Apr 26, 2025
  2. okuuva commented on Apr 26, 2025

    @okuuva
    Author

    For reference: when treesitter is installed and configured, the link renders correctly with ufo enabled while the checkboxes still do not:

    Image

    Github icon might be coming from my nerd-font; none of the screenshots have nvim-web-icons installed.

  3. kevinhwang91 commented on Apr 27, 2025

    @kevinhwang91
    Owner

    Need to capture overlay virt text

  4. added
    enhancement
    and removed
    bug
    on Apr 27, 2025
  5. gogongxt commented on Jun 13, 2025

    @gogongxt

    Is this problem solved? I also found that my fold_virt_text_handler cannot use after update nvim from 0.10.2 to 0.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0