kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.16k stars 37 forks source link

Folding Hides Function Names with ufo.nvim #204

Closed alitokur closed 3 months ago

alitokur commented 3 months ago

Neovim version (nvim -v | head -n1)

NVIM v0.10.0-dev

Operating system/version

macOS

config

vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]

-- these are "extra", change them as you like
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)

-- Option 3: treesitter as a main provider instead
-- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
require("ufo").setup(
  {
    provider_selector = function(bufnr, filetype, buftype)
      return {"treesitter", "indent"}
    end
  }
)

Expected behavior

I expect the function names or at least the first line of the fold to remain visible after folding the code, which would allow for easy identification of folded sections.

Actual behavior

The function names disappear. before:

Screenshot 2024-03-09 at 18 10 18

After:

Screenshot 2024-03-09 at 18 09 46
kevinhwang91 commented 3 months ago

https://github.com/kevinhwang91/nvim-ufo/issues/190