Replies: 4 comments 2 replies
-
Are you on nightly? I think it might be nvim issue actually as both components updated immediately in the past but I have seen this behaviour for a while now as well. |
Beta Was this translation helpful? Give feedback.
-
Related #139 |
Beta Was this translation helpful? Give feedback.
-
I was annoyed enough to bisect this today. The behavior was introduced in neovim/neovim@fe11079. Just noting this here in case anyone wants to open an issue before I get to it. minimal init.lua: local plugins = {
gitsigns = 'lewis6991/gitsigns.nvim',
heirline = 'rebelot/heirline.nvim',
}
local plugin_path = '/tmp/nvim-bisect/plugins/'
(vim.uv or vim.loop).fs_mkdir(plugin_path, 0755)
for name, path in pairs(plugins) do
local fullpath = plugin_path .. name
if not (vim.uv or vim.loop).fs_stat(fullpath) then
-- stylua: ignore
vim.fn.system({ 'git', 'clone', '--depth=1', '--filter=tree:0', 'https://github.com/' .. path, fullpath, })
end
vim.opt.rtp:append(fullpath)
end
require('gitsigns').setup()
local function git_diff_component(s, icon)
return {
condition = function(self)
return self.status_dict[s] ~= nil and self.status_dict[s] > 0
end,
provider = function(self)
return ' ' .. icon .. self.status_dict[s]
end,
}
end
require('heirline').setup({
statusline = {
condition = require('heirline.conditions').is_git_repo,
init = function(self)
self.status_dict = vim.b.gitsigns_status_dict
end,
update = { 'User', patterh = 'GitSignsUpdate' },
{ -- branch
provider = function(self)
return self.status_dict.head
end,
},
git_diff_component('added', '+'),
git_diff_component('changed', '~'),
git_diff_component('removed', '-'),
},
}) bisect log:
|
Beta Was this translation helpful? Give feedback.
-
This solved it for me: update = {
'User',
pattern = 'GitSignsUpdate',
callback = vim.schedule_wrap(function() vim.cmd 'redrawstatus' end),
} update = {
'DiagnosticChanged',
'BufEnter',
callback = vim.schedule_wrap(function()
vim.cmd 'redrawstatus'
vim.cmd 'redrawtabline'
end),
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a diagnostics component similar to the one in the cookbook. However, I noticed that despite having
update = { "DiagnosticChanged", "BufEnter" }
, diagnostics only get updated once I start moving the cursor.At the moment, I added an autocommand in my config instead to get around this:
This works fine for me but I just want to understand why simply adding
update = { "DiagnosticChanged", "BufEnter" }
does not work as expected. Most likely I'm missing something.Something similar happens in the gitdiff component with
update = "GitSignsUpdate"
. Instead, I had to add this autocommand as mentioned in the gitsigns documentation:Note that this didn't work for me either:
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions