|
4 | 4 | -- z.lua - a cd command that learns, by skywind 2018, 2019
|
5 | 5 | -- Licensed under MIT license.
|
6 | 6 | --
|
7 |
| --- Version 1.5.7, Last Modified: 2019/02/21 11:07 |
| 7 | +-- Version 1.5.8, Last Modified: 2019/02/21 12:08 |
8 | 8 | --
|
9 | 9 | -- * 10x faster than fasd and autojump, 3x faster than z.sh
|
10 | 10 | -- * available for posix shells: bash, zsh, sh, ash, dash, busybox
|
@@ -1461,8 +1461,9 @@ function z_cd(patterns)
|
1461 | 1461 | cmd = ((fzf == '') and 'fzf' or fzf) .. ' ' .. cmd .. ' ' .. flag
|
1462 | 1462 | if not windows then
|
1463 | 1463 | 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 |
1466 | 1467 | end
|
1467 | 1468 | cmd = cmd .. ' < "' .. tmpname .. '"'
|
1468 | 1469 | else
|
@@ -2005,8 +2006,9 @@ function z_shell_init(opts)
|
2005 | 2006 | print(script_complete_bash)
|
2006 | 2007 | if opts.fzf ~= nil then
|
2007 | 2008 | 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 .. ' ' |
2010 | 2012 | end
|
2011 | 2013 | local flag = os.environ('_ZL_FZF_FLAG', '')
|
2012 | 2014 | flag = (flag == '' or flag == nil) and '+s -e' or flag
|
|
0 commit comments