Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folding Hides Function Names with ufo.nvim #204

Closed
alitokur opened this issue Mar 9, 2024 · 1 comment
Closed

Folding Hides Function Names with ufo.nvim #204

alitokur opened this issue Mar 9, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@alitokur
Copy link

alitokur commented Mar 9, 2024

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

@alitokur alitokur added the bug Something isn't working label Mar 9, 2024
@kevinhwang91
Copy link
Owner

#190

@kevinhwang91 kevinhwang91 added duplicate This issue or pull request already exists and removed bug Something isn't working labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants