From 8e8d18ed8db0d353bbccfae53dabf104ea39e56f Mon Sep 17 00:00:00 2001 From: Lucario387 Date: Mon, 15 Aug 2022 19:26:25 +0900 Subject: [PATCH] fix: not detecting subdir in git repo --- lua/core/lazy_load.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/core/lazy_load.lua b/lua/core/lazy_load.lua index 1ddd62f..a12ad11 100644 --- a/lua/core/lazy_load.lua +++ b/lua/core/lazy_load.lua @@ -79,11 +79,11 @@ M.mason_cmds = { M.gitsigns = function() autocmd({ "BufRead" }, { callback = function() - if vim.fn.isdirectory ".git" ~= 0 then - vim.schedule(function() - require("packer").loader "gitsigns.nvim" - end) - end + vim.fn.system([[git rev-parse 2>/dev/null]]) + if vim.v.shell_error == 0 then + vim.schedule(function() + require("packer").loader "gitsigns.nvim" + end) end, }) end