toggle-lsp-diagnostics.nvim icon indicating copy to clipboard operation
toggle-lsp-diagnostics.nvim copied to clipboard

Error on :ToggleDiagOff

Open ol-imorozko opened this issue 1 year ago • 3 comments

E5108: Error executing lua ...ggle-lsp-diagnostics.nvim/lua/toggle_lsp_diagnostics.lua:44: attempt to index a nil value
stack traceback:
        ...ggle-lsp-diagnostics.nvim/lua/toggle_lsp_diagnostics.lua:44: in function 'current_settings'
        ...ggle-lsp-diagnostics.nvim/lua/toggle_lsp_diagnostics.lua:133: in function 'configure_diagnostics'
        ...ggle-lsp-diagnostics.nvim/lua/toggle_lsp_diagnostics.lua:57: in function 'turn_off_diagnostics'
        [string ":lua"]:1: in main chunk

nvim --version shows

NVIM v0.9.0-dev-1291+gbad218cd6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/__w/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include

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

Run :checkhealth for more info

ol-imorozko avatar Apr 02 '23 12:04 ol-imorozko

Pinning to commit a7839742dadf90177f3a9ea4747e79f404d10af3 was my workaround.

pedrohdz avatar Apr 20 '23 12:04 pedrohdz

Apologies for being so late to this. Real life got in the way.

Can you share more information about your setup? I cannot replicate this with nvim 0.9.0, 0.9,1, or 0.10.0.

What I am doing:

  1. open a file that will show diagnostics
  2. :ToggleDiagOff
  3. I observe the diagnostics are turned off

I do not see any errors.

WhoIsSethDaniel avatar Jun 11 '23 19:06 WhoIsSethDaniel

I had the same issue as @ol-imorozko, when I installed with packer and forgot to add the init() function call to my config.

aleksmark98 avatar Jul 08 '23 09:07 aleksmark98