skywind3000 / skywind3000/z.lua
Lose order of the completions problem
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.1k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/skywind3000/z.lua/blob/a3d4f5db684ed6dfd3041e73d1d761f5fe944179/z.lua#L2243
_describe helper will lose the order of completion from zlua, suggest change it to code below for remain the completions order
compadd -U -V zlua "${(@)completions}"
and I'm looking for a way to make z complete like cd when zlua's output is empty:
_zlua_zsh_tab_completion() {
(( $+compstate )) && compstate[insert]=menu
local completions=(${(f)"$(_zlua --complete "${words/_zlua/z}")"})
if [[ ${#completions[@]} == 0 ]]; then
_files -/
else
compadd -U -V zlua "${(@)completions}"
fi
}
hope @skywind3000 can handle the code merge
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at z.lua around line 2243 and inspect the _describe helper used for zsh completion. Compare its completion handling with the proposed zsh function, including the empty-output fallback to _files -/. Done means completion order is preserved and z can fall back to directory completion when zlua returns no results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, zsh
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100