You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after upgrading gitsign to latest my configuration is broken. I have the following config using lazy plugin manager
config = function()
require('gitsigns').setup{
signs = {
add = { text = '+' },
change = { text = '' },
delete = { text = '-' },
topdelete = { text = '‾' },
changedelete = { text = '' },
untracked = { text = '┆' },
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, {expr=true})
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, {expr=true})
-- Actions
map('n', '<leader>hs', gs.stage_hunk)
map('n', '<leader>hr', gs.reset_hunk)
map('v', '<leader>hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('v', '<leader>hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end)
map('n', '<leader>hS', gs.stage_buffer)
map('n', '<leader>hu', gs.undo_stage_hunk)
map('n', '<leader>hR', gs.reset_buffer)
map('n', '<leader>hp', gs.preview_hunk)
map('n', '<leader>hb', function() gs.blame_line{full=true} end)
map('n', '<leader>tb', gs.toggle_current_line_blame)
map('n', '<leader>hd', gs.diffthis)
map('n', '<leader>hD', function() gs.diffthis('~') end)
map('n', '<leader>td', gs.toggle_deleted)
-- Text object
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
}
end
when gitsigns is loaded I get the following error
Error 08:09:09 PM notify.error lazy.nvim Failed to run config for gitsigns.nvim
after some debugging I found out that commit that broke my config is
tree 8b471841831b9932f14b1b47507512a0c3b13ab5
parent cf1ffe6
author dundargoc gocdundar@gmail.com Tue Jan 28 14:16:15 2025
committer Lewis Russell me@lewisr.dev Wed Feb 5 15:34:26 2025
fix: use non-deprecated versions of vim.validate
This will remove stack traces from :checkhealth vim.deprecated.
if I revert this change my config works again
vim.validate({ [k] = { v, ty } })
validate(k, v, ty)
Neovim version
NVIM v0.11.0-dev-323+g8f5e90811
Operating system and version
Linux mint "21.3 (Virginia)"
Expected behavior
gitsigns use the provided custom sighs
Actual behavior
Error during validation
Error 08:09:09 PM notify.error lazy.nvim Failed to run config for gitsigns.nvim
if I can help a bit more
M.schema has signs type as
type_help = 'table',
type = validate_signs,
but
--- @Class (exact) Gitsigns.Config
--- @field signs table<Gitsigns.SignType,Gitsigns.SignConfig>
that's also a mismatch. if I update the type in schema to table then it works.
Description
after upgrading gitsign to latest my configuration is broken. I have the following config using lazy plugin manager
config = function()
require('gitsigns').setup{
signs = {
add = { text = '+' },
change = { text = '
' },' },delete = { text = '-' },
topdelete = { text = '‾' },
changedelete = { text = '
untracked = { text = '┆' },
},
when gitsigns is loaded I get the following error
Error 08:09:09 PM notify.error lazy.nvim Failed to run
config
for gitsigns.nvim...al/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/config.lua:899: signs: expected function: 0x7f08a9de7268, got table (table: 0x7f08aa2e04d8)
stacktrace:
after some debugging I found out that commit that broke my config is
tree 8b471841831b9932f14b1b47507512a0c3b13ab5
parent cf1ffe6
author dundargoc gocdundar@gmail.com Tue Jan 28 14:16:15 2025
committer Lewis Russell me@lewisr.dev Wed Feb 5 15:34:26 2025
fix: use non-deprecated versions of vim.validate
This will remove stack traces from
:checkhealth vim.deprecated
.if I revert this change my config works again
Neovim version
NVIM v0.11.0-dev-323+g8f5e90811
Operating system and version
Linux mint "21.3 (Virginia)"
Expected behavior
gitsigns use the provided custom sighs
Actual behavior
Error during validation
Error 08:09:09 PM notify.error lazy.nvim Failed to run
config
for gitsigns.nvim...al/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/config.lua:899: signs: expected function: 0x7f08a9de7268, got table (table: 0x7f08aa2e04d8)
stacktrace:
Minimal config
Steps to reproduce
Gitsigns debug messages
Gitsigns cache
The text was updated successfully, but these errors were encountered: