From 1ee99e04736bdb6044e75cfde16c54a6856ea9cc Mon Sep 17 00:00:00 2001 From: JL Bas <35406425+jlbas@users.noreply.github.com> Date: Thu, 13 May 2021 06:24:51 -0400 Subject: [PATCH] enhancement: show diff when component is loaded (#234) --- lua/lualine/components/diff.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lualine/components/diff.lua b/lua/lualine/components/diff.lua index e537d72..5c5aede 100644 --- a/lua/lualine/components/diff.lua +++ b/lua/lualine/components/diff.lua @@ -62,6 +62,10 @@ Diff.new = function(self, options, child) } end + -- call update functions so git diff is present when component is loaded + Diff.update_git_diff_getter() + Diff.update_git_diff() + vim.api.nvim_exec([[ autocmd lualine BufEnter * lua require'lualine.components.diff'.update_git_diff_getter() autocmd lualine BufEnter * lua require'lualine.components.diff'.update_git_diff()