fix(zsh): Tab completion and colby buffer expansion

Fix fzf_default_completion stale pointer after zle -D by setting it to
expand-or-complete before deleting the lazy comp widget. Rebind ^I
explicitly after widget deletion and add safety net in widgets.zsh
after bindkey -e.

Replace colby() function with ^M buffer expansion so the full
copilot --allow-all-tools --allow-all-paths invocation is visible
in terminal history and screen recordings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-27 16:21:58 +00:00
parent ec8d41b396
commit 789ef71771
3 changed files with 21 additions and 2 deletions

View File

@@ -88,11 +88,14 @@ _dots_init_completion() {
# Stub that loads real completion on first Tab, then replays the keypress
_dots_lazy_comp_widget() {
_dots_init_completion
# Point fzf fallback to real completion before removing this widget
fzf_default_completion=expand-or-complete
zle -D _dots_lazy_comp_widget
# If fzf-completion exists (loaded via zle-line-init), use it; otherwise default
if (( ${+widgets[fzf-completion]} )); then
bindkey '^I' fzf-completion
zle fzf-completion "$@"
else
bindkey '^I' expand-or-complete
zle expand-or-complete "$@"
fi
}