From 1fe75188c3c014fd122d309dfc47cce79c48de89 Mon Sep 17 00:00:00 2001 From: syIvii <119613700+syIvii@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:26:45 -0800 Subject: [PATCH] make argc if statement more readable I was just skimming the code until I saw the vim.fn.argc snippet, I didn't know what was going on at first and did a quick google search just declared a variable so that the reader knows whats going on --- lua/lazyvim/config/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 74919568..61ee88ec 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -79,7 +79,9 @@ function M.setup(opts) error("Exiting") end - if vim.fn.argc(-1) == 0 then + -- + local file_argument = vim.fn.argc(-1) == 0 + if file_argument then -- autocmds and keymaps can wait to load vim.api.nvim_create_autocmd("User", { group = vim.api.nvim_create_augroup("LazyVim", { clear = true }),