HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
490 stars 37 forks source link

[Bug]: Cannot disable in strategy function #10

Closed mehalter closed 1 year ago

mehalter commented 1 year ago

Neovim version

0.9.1

Language affected

No response

Query

No response

Strategy

No response

Description

I am currently trying to set up a strategy function to disable rainbow-delimiters on large files. According to the docs if I return nil in a strategy function it should disable, but I'm actually just getting an error:

Error detected while processing BufReadPost Autocommands for "*":                                                                                                                                                                                                                 
Error executing lua callback: .../installs/neovim/nightly/share/nvim/runtime/filetype.lua:21: Error executing lua: .../installs/neovim/nightly/share/nvim/runtime/filetype.lua:22: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lu
a callback: ...zy/rainbow-delimiters.nvim/plugin/rainbow-delimiters.lua:106: attempt to index local 'strategy' (a nil value)                                                                                                                                                      
stack traceback:                                                                                                                                                                                                                                                                  
        ...zy/rainbow-delimiters.nvim/plugin/rainbow-delimiters.lua:106: in function 'attach'                                                                                                                                                                                     
        ...zy/rainbow-delimiters.nvim/plugin/rainbow-delimiters.lua:156: in function <...zy/rainbow-delimiters.nvim/plugin/rainbow-delimiters.lua:152>   
HiPhish commented 1 year ago

It should be fixed on the current master, please try it out.

mehalter commented 1 year ago

Thanks! Seems resolved on master!