Skip to content

Commit 7c1c73a

Browse files
author
skywind3000
committed
1. upgrade internal batch script
2. made _ZL_FZF_HEIGHT available on windows.
1 parent b63a38b commit 7c1c73a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

z.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- z.lua - a cd command that learns, by skywind 2018-2022
55
-- Licensed under MIT license.
66
--
7-
-- Version 1.8.18, Last Modified: 2024/04/30 17:11
7+
-- Version 1.8.22, Last Modified: 2025/05/17 13:54:38
88
--
99
-- * 10x faster than fasd and autojump, 3x faster than z.sh
1010
-- * available for posix shells: bash, zsh, sh, ash, dash, busybox
@@ -1670,12 +1670,12 @@ function z_cd(patterns)
16701670
local flag = os.environ('_ZL_FZF_FLAG', '')
16711671
flag = (flag == '' or flag == nil) and '+s -e' or flag
16721672
cmd = ((fzf == '') and 'fzf' or fzf) .. ' ' .. cmd .. ' ' .. flag
1673+
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
1674+
if height ~= nil and height ~= '' and height ~= '0' then
1675+
cmd = cmd .. ' --height ' .. height
1676+
end
16731677
if not windows then
16741678
tmpname = os.tmpname()
1675-
local height = os.environ('_ZL_FZF_HEIGHT', '35%')
1676-
if height ~= nil and height ~= '' and height ~= '0' then
1677-
cmd = cmd .. ' --height ' .. height
1678-
end
16791679
cmd = cmd .. ' < "' .. tmpname .. '"'
16801680
else
16811681
tmpname = os.tmpname():gsub('[\\:]', ''):gsub('%.', '')
@@ -2655,7 +2655,9 @@ if /i "%1"=="--purge" (
26552655
)
26562656
:check
26572657
if /i "%1"=="" (
2658-
set "RunMode=-l"
2658+
if /i "%InterMode%"=="" (
2659+
set "RunMode=-l"
2660+
)
26592661
)
26602662
for /f "delims=" %%i in ('cd') do set "PWD=%%i"
26612663
if /i "%RunMode%"=="-n" (

0 commit comments

Comments
 (0)