lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.07k stars 102 forks source link

Bad argument error in latest version #808

Closed AnthonyCalandra closed 8 months ago

AnthonyCalandra commented 8 months ago

Problem

I get the following error when I scroll with my mouse or using key commands in a particular YAML file. I've edited this file before and it worked fine so I suspect this is a recent issue. ~Seems to work fine on source files such as cpp or header files.~

Here's the error and stacktrace:

Error detected while processing FileType Autocommands for "*": Error executing lua callback: ...azyVim-data/lazy/indent-blankline.nvim/lua/ibl/hooks.lua:240: bad argument #1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' ...azyVim-data/lazy/indent-blankline.nvim/lua/ibl/hooks.lua:240: in function 'fn' ...LazyVim-data/lazy/indent-blankline.nvim/lua/ibl/init.lua:304: in function 'refresh' ...LazyVim-data/lazy/indent-blankline.nvim/lua/ibl/init.lua:128: in function 'debounced_refresh' ...LazyVim-data/lazy/indent-blankline.nvim/lua/ibl/init.lua:144: in function 'debounced_refresh' ...Vim-data/lazy/indent-blankline.nvim/lua/ibl/autocmds.lua:27: in function <...Vim-data/lazy/indent-blankline.nvim/lua/ibl/autocmds.lua:26> [C]: in function 'nvim_exec_autocmds' ...yVim-data/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:157: in function <...yVim-data/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156> [C]: in function 'xpcall' ...Local/LazyVim-data/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try' ...yVim-data/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156: in function 'trigger' ...al/LazyVim-data/lazy/LazyVim/lua/lazyvim/util/plugin.lua:103: in function 'cb' vim/_editor.lua:263: in function <vim/_editor.lua:262>

Steps to reproduce

Works fine with a minimal reproducible example:

  1. Create min-init.lua
    
    local lazypath = "/tmp/lazy/lazy.nvim"
    if not vim.loop.fs_stat(lazypath) then
    vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }
    end
    vim.opt.rtp:prepend(lazypath)
    vim.opt.termguicolors = true

require("lazy").setup ({ { "lukas-reineke/indent-blankline.nvim", config = function() require("ibl").setup {} end, }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup { ensure_installed = { "yaml" }, -- change this to the language you use } end, }, }, { root = "/tmp/lazy" })


2. `nvim --clean -u min-init.lua config.yaml`
3. Works as expected; can scroll throughout the file without issues.

**Without minimal reproducible example:**

1. `nvim config.yaml`
2. Scroll around the file and the above error occurs.

### Expected behavior

1. `nvim config.yaml`
2. Scroll throughout the entire file without errors.

### Neovim version (nvim -v)

NVIM v0.9.2
lukas-reineke commented 8 months ago

Probably broke with #802 I'm busy now, but I'll try to make a fix sometime tonight Sorry about that

AnthonyCalandra commented 8 months ago

No problem at all :) Thanks for your quality plugin and your time, we all appreciate it

lukas-reineke commented 8 months ago

Released a fix

AnthonyCalandra commented 8 months ago

Thanks, I'll re-enable the plugin now and open the issue again if I see any issues. 👍