From 1546c82b675cde870ee658f73bf6fe372565cfd4 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Mon, 17 Jan 2022 08:02:50 -0800 Subject: [PATCH] pass $FZF_PREVIEW_LINES|$FZF_PREVIEW_COLUMNS to git_diff cmd (#313) --- lua/fzf-lua/previewer/fzf.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/fzf-lua/previewer/fzf.lua b/lua/fzf-lua/previewer/fzf.lua index 1aa9df9..8b54cc8 100644 --- a/lua/fzf-lua/previewer/fzf.lua +++ b/lua/fzf-lua/previewer/fzf.lua @@ -161,7 +161,7 @@ end function Previewer.git_diff:cmdline(o) o = o or {} - local act = shell.preview_action_cmd(function(items) + local act = shell.preview_action_cmd(function(items, fzf_lines, fzf_columns) if not items or vim.tbl_isempty(items) then utils.warn("shell error while running preview action.") return @@ -186,7 +186,8 @@ function Previewer.git_diff:cmdline(o) vim.fn.executable(self.pager:match("[^%s]+")) == 1 then pager = '| ' .. self.pager end - cmd = string.format('%s %s %s', cmd, vim.fn.shellescape(file.path), pager) + cmd = string.format('FZF_PREVIEW_LINES=%d;FZF_PREVIEW_COLUMNS=%d;%s %s %s', + fzf_lines, fzf_columns, cmd, vim.fn.shellescape(file.path), pager) if self.opts.debug then print("[DEBUG]: "..cmd.."\n") end