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:
Junegunn Choi 2017-12-09 23:21:26 +09:00
parent 11b7fb91e1
commit 009c58b481
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627
2 changed files with 3 additions and 5 deletions

View file

@ -37,8 +37,8 @@ if `file --mime "#{file}"` =~ /binary/
end end
center = (center || 0).to_i center = (center || 0).to_i
if ENV['FZF_PREVIEW_HEIGHT'] if ENV['LINES']
height = ENV['FZF_PREVIEW_HEIGHT'].to_i height = ENV['LINES'].to_i
else else
height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40 height = File.readable?('/dev/tty') ? `stty size < /dev/tty`.split.first.to_i : 40
height /= 2 if split height /= 2 if split

View file

@ -36,9 +36,7 @@ if [ -z "$CENTER" ]; then
CENTER=1 CENTER=1
fi fi
if [ -n "$FZF_PREVIEW_HEIGHT" ]; then if [ -z "$LINES" ]; then
LINES=$FZF_PREVIEW_HEIGHT
else
if [ -r /dev/tty ]; then if [ -r /dev/tty ]; then
LINES=$(stty size < /dev/tty | awk '{print $1}') LINES=$(stty size < /dev/tty | awk '{print $1}')
else else