From b691d537f2ba97d4c2f8b001ac52a8955abcb5c4 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Mon, 25 Feb 2019 23:20:15 +0800 Subject: [PATCH] `z -b` should not match current directory, close #56 --- README.md | 1 + z.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82f22dc..cdda419 100644 --- a/README.md +++ b/README.md @@ -458,6 +458,7 @@ As you see, z.lua is the fastest one and requires less resource. ## History +- 1.5.9 (2019-02-25): `z -b` should not match current directory (close #56). - 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. diff --git a/z.lua b/z.lua index 383c75c..150beec 100755 --- a/z.lua +++ b/z.lua @@ -4,7 +4,7 @@ -- z.lua - a cd command that learns, by skywind 2018, 2019 -- Licensed under MIT license. -- --- Version 1.5.8, Last Modified: 2019/02/21 12:08 +-- Version 1.5.9, Last Modified: 2019/02/25 23:17 -- -- * 10x faster than fasd and autojump, 3x faster than z.sh -- * available for posix shells: bash, zsh, sh, ash, dash, busybox @@ -1555,6 +1555,7 @@ function cd_backward(args, options, pwd) end return os.path.normpath(path) else + pwd = os.path.split(pwd) local test = windows and pwd:gsub('\\', '/') or pwd local key = windows and args[1]:lower() or args[1] if not key:match('%u') then