Skip to content

Commit 5f7fa92

Browse files
author
skywind3000
committed
new $_ZL_FZF_HEIGHT, set to 0 to use fullscreen
1 parent 68de23e commit 5f7fa92

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ As you see, z.lua is the fastest one and requires less resource.
458458

459459
## History
460460

461+
- 1.5.8 (2019-02-21): new `$_ZL_FZF_HEIGHT` to control `--height` parameter in fzf.
461462
- 1.5.7 (2019-02-21): rename `$_ZL_FZF_SORT` to `$_ZL_INT_SORT` it will affect both `-i` and `-I`.
462463
- 1.5.6 (2019-02-20): set `$_ZL_FZF_SORT` to 1 to sort directories by alphabet in fzf.
463464
- 1.5.5 (2019-02-20): `$_ZL_FZF_FLAG` can be used to override fzf flags, default to "+s -e".

z.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- z.lua - a cd command that learns, by skywind 2018, 2019
55
-- Licensed under MIT license.
66
--
7-
-- Version 1.5.7, Last Modified: 2019/02/21 11:07
7+
-- Version 1.5.8, Last Modified: 2019/02/21 12:08
88
--
99
-- * 10x faster than fasd and autojump, 3x faster than z.sh
1010
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
@@ -1461,8 +1461,9 @@ function z_cd(patterns)
14611461
cmd = ((fzf == '') and 'fzf' or fzf) .. ' ' .. cmd .. ' ' .. flag
14621462
if not windows then
14631463
tmpname = os.tmpname()
1464-
if not os.environ('_ZL_FZF_FULLSCR', false) then
1465-
cmd = cmd .. ' --height 35%'
1464+
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
1465+
if height ~= nil and height ~= '' and height ~= '0' then
1466+
cmd = cmd .. ' --height ' .. height
14661467
end
14671468
cmd = cmd .. ' < "' .. tmpname .. '"'
14681469
else
@@ -2005,8 +2006,9 @@ function z_shell_init(opts)
20052006
print(script_complete_bash)
20062007
if opts.fzf ~= nil then
20072008
fzf_cmd = "fzf --nth 2.. --reverse --inline-info --tac "
2008-
if not os.environ('_ZL_FZF_FULLSCR', false) then
2009-
fzf_cmd = fzf_cmd .. ' --height 35%'
2009+
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
2010+
if height ~= nil and height ~= '' and height ~= '0' then
2011+
fzf_cmd = fzf_cmd .. ' --height ' .. height .. ' '
20102012
end
20112013
local flag = os.environ('_ZL_FZF_FLAG', '')
20122014
flag = (flag == '' or flag == nil) and '+s -e' or flag

0 commit comments

Comments
 (0)