mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-07 05:04:30 +08:00
Use $LINES instead of $FZF_PREVIEW_HEIGHT
Since 0.17.3, fzf exports $LINES and $COLUMNS to preview process. FZF_PREVIEW_HEIGHT will be deprecated.
This commit is contained in:
@@ -37,8 +37,8 @@ if `file --mime "#{file}"` =~ /binary/
|
||||
end
|
||||
|
||||
center = (center || 0).to_i
|
||||
if ENV['FZF_PREVIEW_HEIGHT']
|
||||
height = ENV['FZF_PREVIEW_HEIGHT'].to_i
|
||||
if ENV['LINES']
|
||||
height = ENV['LINES'].to_i
|
||||
else
|
||||
height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40
|
||||
height /= 2 if split
|
||||
|
||||
@@ -36,9 +36,7 @@ if [ -z "$CENTER" ]; then
|
||||
CENTER=1
|
||||
fi
|
||||
|
||||
if [ -n "$FZF_PREVIEW_HEIGHT" ]; then
|
||||
LINES=$FZF_PREVIEW_HEIGHT
|
||||
else
|
||||
if [ -z "$LINES" ]; then
|
||||
if [ -r /dev/tty ]; then
|
||||
LINES=$(stty size < /dev/tty | awk '{print $1}')
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user