sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.57k stars 101 forks source link

[Bug] diffview/utils.lua:8: attempt to index global 'DiffviewGlobal' (a nil value) #498

Closed TamaMcGlinn closed 1 month ago

TamaMcGlinn commented 1 month ago

Description

I just updated from 3dc498c to the next commit, 4005c96, and got this error upon starting up NeoVim v0.10.0-dev-2791+g99b3a068d. The error is consistently there in the latter, while not in the former.

My diffview configuration is here, it may be out of date but has worked for me since jan. 2022 with very few changes (latest update was the log_options deprecation).

Error detected while processing /home/my_username/.config/nvim/init.vim[42]../home/my_username/vimrc/git.vim[6]../home/my_username/vimrc/diffview.vim:
line  128:
E5108: Error executing lua ...my_username/.vim/plugged/diffview.nvim/lua/diffview/utils.lua:8: attempt to index global 'DiffviewGlobal' (a nil value)
stack traceback:
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/utils.lua:8: in main chunk
        [C]: in function 'handler'
        ...
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/lazy.lua:35: in function '__index'
        ...
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/events.lua:9: in main chunk
        [C]: in function 'require'
        ...
        [C]: in function 'require'
        [
Error detected while processing /home/my_username/.vim/plugged/diffview.nvim/plugin/diffview.lua:
E5113
stack traceback:
        [
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/lazy.lua:23: in function '__get'
        ...
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/oop.lua:16: in function 'enum'
        ...
        [C]: in function 'require'
        ...
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/lazy.lua:23: in function '__get'
        ...
        ...my_username/.vim/plugged/diffview.nvim/lua/diffview/bootstrap.lua:48: in main chunk
        [C]: in function 'require'
        .../

Expected behavior

Nothing.

Actual behavior

The error.

Steps to reproduce

nvim

Health check

Output of :checkhealth diffview ``` ============================================================================== diffview: require("diffview.health").check() Checking plugin dependencies ~ - OK nvim-web-devicons installed. Checking VCS tools ~ - The plugin requires at least one of the supported VCS tools to be valid. - ERROR Failed to run healthcheck for "diffview" plugin. Exception: ...my_username/.vim/plugged/diffview.nvim/lua/diffview/lazy.lua:23: loop or previous error loading module 'diffview.utils' ```

Log info

Relevant info from :DiffviewLog ``` ############################ ### PUT LOG CONTENT HERE ### ############################ ```

Neovim version

NVIM v0.10.0-dev-2791+g99b3a068d
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188

Operating system and version

Ubuntu

Minimal config

No response

TamaMcGlinn commented 1 month ago

Nice! Thank you! It works.