p00f/nvim-ts-rainbow

E5108: Error executing lua vim/_editor.lua:0: attempt to call method 'byte' (a nil value)

overcache opened this issue · 3 comments

Describe the bug
neovim throw error with nvim-ts-rainbow installed.

Error detected while processing FileType Autocommands for "*":
E5108: Error executing lua vim/_editor.lua:0: attempt to call method 'byte' (a nil value)
stack traceback:
        vim/_editor.lua: in function 'region'
        ....bundle/Contents/Resources/runtime/lua/vim/highlight.lua:35: in function 'range'
        ...ck/packer/start/nvim-ts-rainbow/lua/rainbow/internal.lua:64: in function 'update_range'
        ...ck/packer/start/nvim-ts-rainbow/lua/rainbow/internal.lua:99: in function 'fn'
        ...ts/Resources/runtime/lua/vim/treesitter/languagetree.lua:194: in function 'for_each_tree'
        ...ck/packer/start/nvim-ts-rainbow/lua/rainbow/internal.lua:98: in function 'full_update'
        ...ck/packer/start/nvim-ts-rainbow/lua/rainbow/internal.lua:161: in function 'attach'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:485: in function 'attach_module'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:508: in function 'reattach_module'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

Steps to reproduce

  • neovim 0.7.0 or neovim 0.8.0-dev
  • install nvim-ts-rainbow
  • open some file contain some {} , by running command: nvim barfoo.json

Expected behavior
no error expected

Screenshots
image

nvim --version
NVIM v0.8.0-dev+1460-g3f2e9298b
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by simon@mba.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-3f2e929/share/nvim"

Run :checkhealth for more info
p00f commented

I'm on the same commit (3f2e9298bdd971a4d2baa298aff7c6f2c2c1ad1a) and I can open https://git.sr.ht/~p00f/dotfiles/tree/zeus/item/desktop/.config/wldash/config.json fine (with rainbow brackets). Please show a specific file with which you have this problem

p00f commented

Note that the issue template specifically asks for an example -

Please also paste the code which has buggy highlighting here.

p00f commented

Closing as there is no example code given