1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-05-03 19:09:21 +02:00

1 Commits

Author SHA1 Message Date
ohmyzsh[bot]
b7e824d57e chore(z): update to acd0e198 2026-05-03 06:59:39 +00:00
3 changed files with 24 additions and 13 deletions

View File

@@ -46,7 +46,7 @@ dependencies:
plugins/z:
branch: master
repo: agkozak/zsh-z
version: 519e5796df3db6c68317c7a3901444fab3241bbc
version: acd0e1984df350c189f8f9c4956ec586b6c73fca
precopy: |
set -e
test -e README.md && mv -f README.md MANUAL.md

View File

@@ -33,11 +33,13 @@ Zsh-z is a drop-in replacement for `rupa/z` and will, by default, use the same d
<details>
<summary>Here are the latest features and updates.</summary>
- May 1, 2026
+ Various tab completion bugs resolved.
- April 27, 2026
+ Fixes a bug where re-sourcing the script caused an infinite loop when Tab was pressed. Props to @maheshpec for [successfully diagnosing the problem](https://github.com/ohmyzsh/ohmyzsh/pull/13715).
+ Fixes a bug where the completion widget was not identifying flags correctly.
+ Fixes a bug where re-sourcing the script caused an infinite loop when tab was pressed. Props to @maheshpec for [successfully diagnosing the problem](https://github.com/ohmyzsh/ohmyzsh/pull/13715).
+ Fixes a bug where the completion widget was not identifying options correctly.
- March 31, 2026
+ When the user hits Tab after entering a command-line argument that uses spaces as wildcards (e.g., `z us lo bi`), the command line is clear of detritus (i.e., it looks like `z /usr/local/bin` instead of `z us lo /usr/local/bin`).
+ When the user hits tab after entering a command-line argument that uses spaces as wildcards (e.g., `z us lo bi`), the command line is clear of detritus (i.e., it looks like `z /usr/local/bin` instead of `z us lo /usr/local/bin`).
+ Improved test for Docker containers.
- August 24, 2023
+ Zsh-z will now run when `setopt NO_UNSET` has been enabled (props @ntninja).

View File

@@ -96,7 +96,7 @@ With no ARGUMENT, list the directory history in ascending rank.
-t Match by recent access
-x Remove a directory from the database (by default, the current directory)
-xR Remove a directory and its subdirectories from the database (by default, the current directory)" |
fold -s -w $COLUMNS >&2
fold -s -w $(( COLUMNS > 0 ? COLUMNS : 80 )) >&2
}
# Load zsh/datetime module, if necessary
@@ -251,7 +251,7 @@ zshz() {
if (( ${ZSHZ_NO_RESOLVE_SYMLINKS:-${_Z_NO_RESOLVE_SYMLINKS}} )); then
[[ -d ${${*:-${PWD}}:a} ]] && xdir=${${*:-${PWD}}:a}
else
[[ -d ${${*:-${PWD}}:A} ]] && xdir=${${*:-${PWD}}:a}
[[ -d ${${*:-${PWD}}:A} ]] && xdir=${${*:-${PWD}}:A}
fi
local -a lines_to_keep
@@ -741,6 +741,9 @@ zshz() {
for opt in ${(k)opts}; do
case $opt in
--add)
# Don't change the database when invoked via --complete (e.g., from
# tab completion).
(( ${+opts[--complete]} )) && continue
[[ ! -d $* ]] && return 1
local dir
# Cygwin and MSYS2 have a hard time with relative paths expressed from /
@@ -764,6 +767,7 @@ zshz() {
;;
-c) [[ $* == ${PWD}/* || $PWD == '/' ]] || prefix="$PWD " ;;
-h|--help)
(( ${+opts[--complete]} )) && continue
_zshz_usage
return
;;
@@ -771,6 +775,7 @@ zshz() {
-r) method='rank' ;;
-t) method='time' ;;
-x)
(( ${+opts[--complete]} )) && continue
# Cygwin and MSYS2 have a hard time with relative paths expressed from /
if [[ $OSTYPE == (cygwin|msys) && $PWD == '/' && $* != /* ]]; then
set -- "/$*"
@@ -844,7 +849,8 @@ zshz() {
# New experimental "uncommon" behavior
#
# If the best choice at this point is something like /foo/bar/foo/bar, and the # search pattern is `bar', go to /foo/bar/foo/bar; but if the search pattern
# If the best choice at this point is something like /foo/bar/foo/bar, and the
# search pattern is `bar', go to /foo/bar/foo/bar; but if the search pattern
# is `foo', go to /foo/bar/foo
if (( ZSHZ_UNCOMMON )) && [[ -n $cd ]]; then
if [[ -n $cd ]]; then
@@ -996,21 +1002,24 @@ _zshz_zle_completion_widget() {
# Only act when there are at least two words after the command
if [[ $LBUFFER == ${cmd}\ *\ * ]]; then
local after=${LBUFFER#${cmd} }
local -a parts flag_parts search_parts
local p past_flags=0
local -a parts option_parts search_parts
local p past_options=0
parts=( ${(z)after} )
for p in $parts; do
if (( ! past_flags )) && [[ $p == (-[cehlrRtx]##|--add|--complete|--help) ]]; then
flag_parts+=( $p )
if (( ! past_options )) && [[ $p == (--|-[cehlrRtx]##|--add|--complete|--help) ]]; then
option_parts+=( $p )
# `--' terminates option parsing; subsequent tokens are positional,
# even if they happen to look like options.
[[ $p == -- ]] && past_options=1
else
past_flags=1
past_options=1
search_parts+=( $p )
fi
done
if (( ${#search_parts} > 1 )); then
LBUFFER="${cmd}${flag_parts:+ ${(j: :)flag_parts}} ${(j:*:)search_parts}"
LBUFFER="${cmd}${option_parts:+ ${(j: :)option_parts}} ${(j:*:)search_parts}"
fi
fi