6390afd6de2978ca19920adb4d8958c1ee788f49

Author
Meng Bo <mengbo@lnu.edu.cn>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

fzf: change debian completion file path (#8402)

* Newer Debian packages install completions file in
/usr/share/doc/fzf/examples/completion.zsh

* Default to buster/stretch path if completion file not found

See file list in order from older to newer fzf package versions:
- https://packages.debian.org/stretch-backports/amd64/fzf/filelist
- https://packages.debian.org/buster/amd64/fzf/filelist
- https://packages.debian.org/bullseye/amd64/fzf/filelist
- https://packages.debian.org/sid/amd64/fzf/filelist

Co-authored-by: Marc Cornellà <marc.cornella@live.com>

Diff

 1diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
 2index fe471a363f9d17dd7572b5d486f4f680192d46b6..83626009d3524dc716ce819786ae72429ac9dab3 100644
 3--- a/plugins/fzf/fzf.plugin.zsh
 4+++ b/plugins/fzf/fzf.plugin.zsh
 5@@ -67,7 +67,10 @@ function setup_using_debian_package() {
 6     # NOTE: There is no need to configure PATH for debian package, all binaries
 7     # are installed to /usr/bin by default
 8 
 9-    local completions="/usr/share/zsh/vendor-completions/_fzf"
10+    # Determine completion file path: first bullseye/sid, then buster/stretch
11+    local completions="/usr/share/doc/fzf/examples/completion.zsh"
12+    [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"
13+
14     local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh"
15 
16     # Auto-completion