Skip to content

Commit

Permalink
Fix git_diff custom source bug with auto-session
Browse files Browse the repository at this point in the history
- git_diff does not cache git_sign_count into diff_cache
when rmagatti/auto-session plugin is used to launch nvim
session with multiple open windows.
- This commit makes sure to not use diff_cache value, but
instead, uses the custom source to get git sign counts
when M.src (custome source for git_diff) is defined.
  • Loading branch information
darrenchang committed Oct 18, 2024
1 parent b431d22 commit 3463bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lualine/components/diff/git_diff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end
---error_code = { added = -1, modified = -1, removed = -1 }
---@param bufnr number|nil
function M.get_sign_count(bufnr)
if bufnr then
if bufnr and not (type(M.src) == 'function') then
return diff_cache[bufnr]
end
if M.src then
Expand Down

0 comments on commit 3463bd0

Please sign in to comment.