lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
365 stars 19 forks source link

attempt to call upvalue 'color2escape' (a nil value) #69

Closed diegoximenes closed 2 years ago

diegoximenes commented 2 years ago

git diff generates the following error:

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua /usr/share/nvimpager/runtime/lua/nvimpager.lua:147: attempt to call upvalue 'color2escape' (a nil value)
stack traceback:
        /usr/share/nvimpager/runtime/lua/nvimpager.lua:147: in function 'group2ansi'
        /usr/share/nvimpager/runtime/lua/nvimpager.lua:161: in function 'init_cat_mode'
        /usr/share/nvimpager/runtime/lua/nvimpager.lua:297: in function 'cat_mode'
        [string ":lua"]:1: in main chunk

neovim version:

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
lucc commented 2 years ago

Thanks for the report. I recently noticed this myself and started working on the blue branch. My solution is the same as yours in #70 but I did not manage to write a test that works consistently for different neovim versions. They changed something in the filetype handling that make the tests fail on some versions of neovim.

lucc commented 2 years ago

I have given up constructing a reliable test that works on 0.6 and 0.7.1 & 0.7.2. I will have come to that problem later or increase the minimum version requirement just for the tests.

But the fix you need is now in main.

diegoximenes commented 2 years ago

Thanks!