From 2348eaea2fba4add3ba3eab0efa0b21ec7fd3cd3 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:13:50 +0600 Subject: [PATCH] enhace: Use nvim_call_function instead of vim.fn so vim.fn does not get populated --- lua/lualine/components/special/eval_func_component.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lualine/components/special/eval_func_component.lua b/lua/lualine/components/special/eval_func_component.lua index 7c82ad0..39befda 100644 --- a/lua/lualine/components/special/eval_func_component.lua +++ b/lua/lualine/components/special/eval_func_component.lua @@ -25,7 +25,7 @@ end EvalFuncComponent.vim_function = function(name) -- vim function component - local ok, return_val = pcall(vim.fn[name]) + local ok, return_val = pcall(vim.api.nvim_call_function, name, {}) if not ok then return '' end -- function call failed ok, return_val = pcall(tostring, return_val) return ok and return_val or ''