Skip to content

Commit

Permalink
zsh: fix zstyle not matching first entry
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 4, 2022
1 parent dc57661 commit 15c5973
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/cmd/_test/zsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function _example_completion {
local lines=($(echo ${words} | sed 's/$/"/' | CARAPACE_ZSH_HASH_DIRS="$(hash -d)" xargs example _carapace zsh))
fi

zstyle ":completion:${curcontext}:*" list-colors "${lines[1]}":
zstyle ":completion:${curcontext}:*" list-colors "${lines[1]}"

local line_break=$'\n'
[[ ! "${lines[2]}" == "NONE" ]] && _message -r "${lines[2]//$'\t'/${line_break}}"
Expand Down
2 changes: 1 addition & 1 deletion internal/shell/zsh/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
vals[index] = fmt.Sprintf("%v\t%v:%v", val.Value, val.Display, val.TrimmedDescription())
}
}
return fmt.Sprintf(":%v\n%v\n%v", zstyles{values}.Format(), message{meta}.Format(), strings.Join(vals, "\n"))
return fmt.Sprintf("%v\n%v\n%v", zstyles{values}.Format(), message{meta}.Format(), strings.Join(vals, "\n"))
}
2 changes: 1 addition & 1 deletion internal/shell/zsh/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function _%v_completion {
local lines=($(echo ${words} | sed 's/$/"/' | CARAPACE_ZSH_HASH_DIRS="$(hash -d)" xargs %v _carapace zsh))
fi
zstyle ":completion:${curcontext}:*" list-colors "${lines[1]}":
zstyle ":completion:${curcontext}:*" list-colors "${lines[1]}"
local line_break=$'\n'
[[ ! "${lines[2]}" == "NONE" ]] && _message -r "${lines[2]//$'\t'/${line_break}}"
Expand Down

0 comments on commit 15c5973

Please sign in to comment.