Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid augroup #482

Closed
levouh opened this issue Mar 3, 2022 · 10 comments
Closed

Invalid augroup #482

levouh opened this issue Mar 3, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@levouh
Copy link
Contributor

levouh commented Mar 3, 2022

Description

Via 865375407e794b7efcab7d28efc51955560d0aaa startup notes:

packer.nvim: Error running config for gitsigns.nvim: ...p
↪.pack/packer/opt/plenary.nvim/lua/plenary/async/async.lu
↪ua:14: The coroutine failed with this message: .../packe
↪er/opt/gitsigns.nvim/lua/gitsigns/nvim/autocmds.lua:8: i
invalid augroup: gitsigns

does not happen with 06aefb1867687ee2b1d206fd5d19a2b254c62f2c, as makes sense.

Neovim version

NVIM v0.7.0-dev+1175-g5d6006f9b

Operating system and version

Linux

Expected behavior

No error on startup

Actual behavior

Error on startup

Minimal config

vim.o.packpath = '/tmp/nvim/site'

local plugins = {
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  plenary  = 'https://github.com/nvim-lua/plenary.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/pack/test/start/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. nvim -nu minimal.lua
  2. ...

Gitsigns debug messages

No response

@levouh levouh added the bug Something isn't working label Mar 3, 2022
@qbedard
Copy link

qbedard commented Mar 3, 2022

Beat me to it.

@levouh
Copy link
Contributor Author

levouh commented Mar 3, 2022

Fastest bug reports NA.

lewis6991 added a commit that referenced this issue Mar 3, 2022
@lewis6991
Copy link
Owner

Very sorry about that, CI should have caught this but didn't because it doesn't run this particular autocmd as setup is run after VimEnter.

Should be fixed in 6d66300

@desilinguist
Copy link

desilinguist commented Mar 3, 2022

After updating, the error from gitsigns is fixed but I get the following error from impatient now:

Error detected while processing VimEnter Autocommands for "*":                                                                                                                                                                                                      
E5108: Error executing lua ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:212: attempt to index a nil value                                                                                                                                            
stack traceback:                                                                                                                                                                                                                                                    
        ...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:212: in function <...ck/packer/start/impatient.nvim/lua/impatient/profile.lua:210>                                                                                                              
        [C]: in function 'require_'                                                                                                                                                                                                                                 
        ...te/pack/packer/start/gitsigns.nvim/lua/gitsigns/nvim.lua:22: in function '__index'                                                                                                                                                                       
        ...ck/packer/start/gitsigns.nvim/lua/gitsigns/highlight.lua:63: in function 'setup_highlights'                                                                                                                                                              
        ...pack/packer/start/gitsigns.nvim/lua/gitsigns/manager.lua:368: in function 'fn'                                                                                                                                                                           
        ...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns.lua:466: in function 'fn'                                                                                                                                                                           
        ...tart/gitsigns.nvim/lua/gitsigns/nvim/autocmds_compat.lua:13: in function <...tart/gitsigns.nvim/lua/gitsigns/nvim/autocmds_compat.lua:13>                                                                                                                
        ...tart/gitsigns.nvim/lua/gitsigns/nvim/autocmds_compat.lua:8: in function '_exec'                                                                                                                                                                          
        [string ":lua"]:1: in main chunk  

@lewis6991
Copy link
Owner

Do you get the error without profiling enabled?

@desilinguist
Copy link

No, without profiling enabled, I don't get the error.

@lewis6991
Copy link
Owner

Good to know, but means it is an Impatient issue.

@desilinguist
Copy link

Shall I file an issue there?

@lewis6991
Copy link
Owner

Actually, I think I've realized the issue and is caused by Gitsigns storing a copy of require. The profiling in impatient is a bit sensitive to that kind of thing.

It does indicate that you may be setting up impatient incorrectly. It needs to be the first thing you require in your Neovim setup, and I think that error is only possible if you load gitsigns first.

@desilinguist
Copy link

Yes, you are right. I was incorrectly loading it after gitsigns. I didn't think it was an issue since the cache log seemed to indicate it was still working fine.

Fixed and the error is gone. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants