From 9f197417dc90d0d90644e29091ff1529281ec33c Mon Sep 17 00:00:00 2001 From: bhagwan Date: Wed, 27 Apr 2022 18:31:14 -0700 Subject: [PATCH] git_status: prevent preview error in bare git repo --- lua/fzf-lua/previewer/fzf.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/fzf-lua/previewer/fzf.lua b/lua/fzf-lua/previewer/fzf.lua index 378664c..0c117f2 100644 --- a/lua/fzf-lua/previewer/fzf.lua +++ b/lua/fzf-lua/previewer/fzf.lua @@ -279,6 +279,7 @@ function Previewer.git_diff:cmdline(o) if is_modified then cmd = self.cmd_modified elseif is_deleted then cmd = self.cmd_deleted elseif is_untracked then cmd = self.cmd_untracked end + if not cmd then return "" end local pager = "" if self.pager and #self.pager>0 and vim.fn.executable(self.pager:match("[^%s]+")) == 1 then