Skip to content

Commit 746477b

Browse files
committed
fix(shell): sort project_open targets and return success from completion guard
1 parent 3e774f2 commit 746477b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

shell/aliases

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,11 @@ _project_open_targets() {
391391
[[ -n "${name}" ]] || return 0
392392
project_path="$(_project_open_resolve "${name}" cache_only)"
393393
[[ -n "${project_path}" ]] || return 0
394-
find "${project_path}" -mindepth 1 -maxdepth 1 -type d -not -name '.*' 2>/dev/null | while IFS= read -r target_dir; do
395-
printf '%s\n' "${target_dir##*/}"
396-
done
394+
find "${project_path}" -mindepth 1 -maxdepth 1 -type d -not -name '.*' 2>/dev/null |
395+
while IFS= read -r target_dir; do
396+
printf '%s\n' "${target_dir##*/}"
397+
done |
398+
LC_ALL=C sort
397399
}
398400

399401
_project_open_complete_bash() {

shell/completions/_project_open

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# the repeated/deferred compinit calls in zshrc. Discovery helpers live in
55
# shell/aliases and are available in the interactive shell.
66

7-
(( $+functions[_project_open_projects] )) || return 1
7+
# Succeed with no candidates if the discovery helpers (from shell/aliases) aren't
8+
# loaded yet, so zsh doesn't treat this as a failed completer.
9+
(( $+functions[_project_open_projects] )) || return 0
810

911
local -a candidates
1012

0 commit comments

Comments
 (0)