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

Error creating a split if fold exist #239

Open
nicolas-sabbatini opened this issue Jul 26, 2024 · 3 comments
Open

Error creating a split if fold exist #239

nicolas-sabbatini opened this issue Jul 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@nicolas-sabbatini
Copy link

Neovim version (nvim -v | head -n1)

NVIM v0.10.1

Operating system/version

Pop!_OS 22.04 LTS

How to reproduce the issue

{
	"kevinhwang91/nvim-ufo",
	dependencies = { "kevinhwang91/promise-async" },
	config = function()
		require("ufo").setup({
			provider_selector = function()
				return { "treesitter", "indent" }
			end,
		})
	end,
}
  1. Open a file
  2. Create a fold
  3. Create a split (<C-w>v)

step-1
step-2
step-3

Expected behavior

The split is created successfully

Actual behavior

An error is trow

E5108: Error executing lua ...co/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:211: attempt to index field 'foldedPairs' (a nil value)
stack traceback:
        ...co/.local/share/nvim/lazy/nvim-ufo/lua/ufo/decorator.lua:211: in function 'getVirtTextAndCloseFold'
        /home/nico/.local/share/nvim/lazy/nvim-ufo/lua/ufo/main.lua:189: in function </home/nico/.local/share/nvim/lazy/nvim-ufo/lua/ufo/main.lua:186>
@nicolas-sabbatini nicolas-sabbatini added the bug Something isn't working label Jul 26, 2024
@kevinhwang91
Copy link
Owner

kevinhwang91 commented Jul 26, 2024

can't reproduce. foldedPairs never become nil if

on_win = onWin,

is fired. I don't know why you encounter this error. The foldtext should render after nvim_set_decoration_provider.on_win.

@nicolas-sabbatini
Copy link
Author

I found the problem, it was the following option on my config:

vim.opt.debug = "msg" -- Show error messages

If I turn off the option the error disappear

@kevinhwang91
Copy link
Owner

still unable to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants