Skip to content

Commit 9fbacf6

Browse files
authored
1 parent 657d53a commit 9fbacf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

functions/_tide_pwd.fish

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ eval "function _tide_pwd
2828
string match -qr \"(?<trunc>\..|.)\" \$dir_section
2929
3030
set -l glob \$parent_dir/\$trunc*/
31-
set -e glob[(contains -i \$parent_dir/\$dir_section/ \$glob)] # This is faster than inverse string match
32-
31+
set -l indices (contains -i $parent_dir/$dir_section/ $glob)
32+
if set -q indices[1]
33+
set -e glob[$indices]
34+
end
3335
while string match -qr \"^\$parent_dir/\$(string escape --style=regex \$trunc)\" \$glob &&
3436
string match -qr \"(?<trunc>\$(string escape --style=regex \$trunc).)\" \$dir_section
3537
end

0 commit comments

Comments
 (0)