Skip to content

Commit

Permalink
new $_ZL_FZF_HEIGHT, set to 0 to use fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Feb 21, 2019
1 parent 68de23e commit 5f7fa92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ As you see, z.lua is the fastest one and requires less resource.

## History

- 1.5.8 (2019-02-21): new `$_ZL_FZF_HEIGHT` to control `--height` parameter in fzf.
- 1.5.7 (2019-02-21): rename `$_ZL_FZF_SORT` to `$_ZL_INT_SORT` it will affect both `-i` and `-I`.
- 1.5.6 (2019-02-20): set `$_ZL_FZF_SORT` to 1 to sort directories by alphabet in fzf.
- 1.5.5 (2019-02-20): `$_ZL_FZF_FLAG` can be used to override fzf flags, default to "+s -e".
Expand Down
12 changes: 7 additions & 5 deletions z.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- z.lua - a cd command that learns, by skywind 2018, 2019
-- Licensed under MIT license.
--
-- Version 1.5.7, Last Modified: 2019/02/21 11:07
-- Version 1.5.8, Last Modified: 2019/02/21 12:08
--
-- * 10x faster than fasd and autojump, 3x faster than z.sh
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
Expand Down Expand Up @@ -1461,8 +1461,9 @@ function z_cd(patterns)
cmd = ((fzf == '') and 'fzf' or fzf) .. ' ' .. cmd .. ' ' .. flag
if not windows then
tmpname = os.tmpname()
if not os.environ('_ZL_FZF_FULLSCR', false) then
cmd = cmd .. ' --height 35%'
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
if height ~= nil and height ~= '' and height ~= '0' then
cmd = cmd .. ' --height ' .. height
end
cmd = cmd .. ' < "' .. tmpname .. '"'
else
Expand Down Expand Up @@ -2005,8 +2006,9 @@ function z_shell_init(opts)
print(script_complete_bash)
if opts.fzf ~= nil then
fzf_cmd = "fzf --nth 2.. --reverse --inline-info --tac "
if not os.environ('_ZL_FZF_FULLSCR', false) then
fzf_cmd = fzf_cmd .. ' --height 35%'
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
if height ~= nil and height ~= '' and height ~= '0' then
fzf_cmd = fzf_cmd .. ' --height ' .. height .. ' '
end
local flag = os.environ('_ZL_FZF_FLAG', '')
flag = (flag == '' or flag == nil) and '+s -e' or flag
Expand Down

0 comments on commit 5f7fa92

Please sign in to comment.