ful1e5 / onedark.nvim

Atom's iconic One Dark theme for Neovim, written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

db5b0f441d4bc47bc95593c59a724be62a23851c causes issues on older nvim 0.7 builds

J-MR-T opened this issue · comments

Hi there.

I had to update to the latest neovim nightly build to fix the error, even though I was already on nvim 0.7

This is the error emitted:

Error detected while processing /home/apoc/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/apoc/.config/nvim/init.lua:10: Vim(lua):E5108: Error executing lua .../pack/
packer/start/onedark.nvim/lua/onedark/autocmds.lua:32: attempt to call field 'nvim_create_augroup' (a nil value)
stack traceback:
        .../pack/packer/start/onedark.nvim/lua/onedark/autocmds.lua:32: in function 'native_cmds'
        ...site/pack/packer/start/onedark.nvim/lua/onedark/util.lua:232: in function 'load'
        ...site/pack/packer/start/onedark.nvim/lua/onedark/init.lua:15: in function 'setup'
        [string ":lua"]:1: in main chunk
        [C]: in function 'nvim_exec'
        /home/apoc/.config/nvim/init.lua:10: in main chunk
stack traceback:
        [C]: in function 'nvim_exec'
        /home/apoc/.config/nvim/init.lua:10: in main chunk

This was my output of nvim --version before I updated:

NVIM v0.7.0-dev+1054-g851252f79
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az242-530

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

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

Run :checkhealth for more info

This is nvim --version after the update

NVIM v0.7.0-dev+1446-g18152cf6f
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az243-502

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

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

Run :checkhealth for more info

I looked at the changes in db5b0f4 and this here has caught my eye:

  local autocmds = require('onedark.autocmds')
  if vim.fn.has('nvim-0.7') == 1 then
    autocmds.native_cmds(hi.config)
  else
    autocmds.viml_cmds(hi.config)
  end

(in lua/onedark/util.lua)

I suspect this check needs to be more thorough, as you can see in the version output above, not all neovim 0.7 builds seem to have the nvim_create_augroup function.

Cheers :)

I did a little digging and this might be a candidate for the api change that might have caused this, not sure though: neovim/neovim@0f61348

Thanks for fixing it so quickly :D