mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-02-27 20:12:29 +08:00
@@ -33,9 +33,13 @@ if `file --mime "#{file}"` =~ /binary/
|
||||
end
|
||||
|
||||
center = (center || 0).to_i
|
||||
height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40
|
||||
height /= 2 if split
|
||||
height -= 2 # preview border
|
||||
if ENV['FZF_PREVIEW_HEIGHT']
|
||||
height = ENV['FZF_PREVIEW_HEIGHT'].to_i
|
||||
else
|
||||
height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40
|
||||
height /= 2 if split
|
||||
height -= 2 # preview border
|
||||
end
|
||||
offset = [1, center - height / 3].max
|
||||
|
||||
IO.popen(['sh', '-c', COMMAND.gsub('{}', Shellwords.shellescape(path))]) do |io|
|
||||
|
||||
Reference in New Issue
Block a user