Skip to content

Commit

Permalink
Merge pull request #1063 from carapace-sh/zsh-slice-words
Browse files Browse the repository at this point in the history
zsh: slice words to current
  • Loading branch information
rsteube authored Dec 26, 2024
2 parents 49b6747 + f2a1910 commit 9503c7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/cmd/_test/zsh.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#compdef example
function _example_completion {
local IFS=$'\n'
local words=${words[@]:0:$CURRENT}

# shellcheck disable=SC2086,SC2154,SC2155
if echo ${words}"''" | xargs echo 2>/dev/null > /dev/null; then
Expand Down
1 change: 1 addition & 0 deletions internal/shell/zsh/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func Snippet(cmd *cobra.Command) string {
return fmt.Sprintf(`#compdef %v
function _%v_completion {
local IFS=$'\n'
local words=${words[@]:0:$CURRENT}
# shellcheck disable=SC2086,SC2154,SC2155
if echo ${words}"''" | xargs echo 2>/dev/null > /dev/null; then
Expand Down

0 comments on commit 9503c7a

Please sign in to comment.