mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
Do not preview binary files
This commit is contained in:
@@ -27,6 +27,11 @@ unless File.readable? path
|
||||
exit 1
|
||||
end
|
||||
|
||||
if `file --mime "#{file}"` =~ /binary/
|
||||
puts "#{file} is a binary file"
|
||||
exit 0
|
||||
end
|
||||
|
||||
center = (center || 0).to_i
|
||||
height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40
|
||||
height /= 2 if split
|
||||
|
||||
Reference in New Issue
Block a user