lewis6991 / gitsigns.nvim

Git integration for buffers
MIT License
5.12k stars 192 forks source link

null-ls format panic when apply path PR#983 #986

Closed 3Xpl0it3r closed 6 months ago

3Xpl0it3r commented 6 months ago

Description

when I upgrade gitsigns to the latest version, then formatter supplied by none-ls was broken

Neovim version

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377

Operating system and version

macos 14.2.1 (23C71)

Expected behavior

No response

Actual behavior

image

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
  local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
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 --clean -u minimal.lua
  2. ...

Gitsigns debug messages

No response

josuetorr commented 6 months ago

got the same issue

sinkr commented 6 months ago

Same issue here.

Dropping back to this commit fixes the issue.

Full error in text:

   Error  21:37:57 msg_show.lua_error Error detected while processing OptionSet Autocommands for "fileformat":
21:37:57 msg_show Error executing lua callback: ...al/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/attach.lua:168: attempt to index a nil value
stack traceback:
    ...al/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/attach.lua:168: in function <...al/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/attach.lua:166>
    [C]: in function 'nvim_buf_set_option'
    .../share/nvim/lazy/none-ls.nvim/lua/null-ls/formatting.lua:33: in function 'handler'
    .../.local/share/nvim/lazy/none-ls.nvim/lua/null-ls/rpc.lua:94: in function 'handle'
    .../.local/share/nvim/lazy/none-ls.nvim/lua/null-ls/rpc.lua:109: in function 'request'
    /usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:685: in function '_request'
    /usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:759: in function 'request_sync'
    .../share/nvim/lazy/conform.nvim/lua/conform/lsp_format.lua:145: in function 'format'
    ....local/share/nvim/lazy/conform.nvim/lua/conform/init.lua:456: in function 'format'
    .../.local/share/nvim/lazy/LazyVim/lua/lazyvim/util/lsp.lua:122: in function <.../.local/share/nvim/lazy/LazyVim/lua/lazyvim/util/lsp.lua:109>
    [C]: in function 'xpcall'
    .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
    ...ocal/share/nvim/lazy/LazyVim/lua/lazyvim/util/format.lua:121: in function 'format'
    ...l/share/nvim/lazy/LazyVim/lua/lazyvim/config/keymaps.lua:90: in function <...l/share/nvim/lazy/LazyVim/lua/lazyvim/config/keymaps.lua:89>
meronogbai commented 6 months ago

dropping back to that commit fixed it for me too