a1c54e03f98b594a6fcc368c2c113d469ffaa368

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

feat(fzf): add `skip-dpkg` flag to avoid some regressions

See https://github.com/ohmyzsh/ohmyzsh/pull/11122#issuecomment-1399607430

Diff

 1diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md
 2index beedf4690993ae12b83fdf80e0a3889c2e9dfec9..7e3e3e5b0e70b7d4657228f9f4c6b67d018c0379 100644
 3--- a/plugins/fzf/README.md
 4+++ b/plugins/fzf/README.md
 5@@ -50,3 +50,12 @@ Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C):
 6 ```zsh
 7 DISABLE_FZF_KEY_BINDINGS="true"
 8 ```
 9+
10+### Skip `dpkg` loading
11+
12+If you have `dpkg` available in your `$PATH` but you don't want to load `fzf` from there, and facing some
13+issues, you can define this option before loading `oh-my-zsh` in order to skip that loading:
14+
15+```zsh
16+zstyle ':omz:plugins:fzf' skip-dpkg yes
17+```
18diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
19index 85a0bf270cfd34ef34ef847976e7b72291e97e5a..c07d3849300c578185d530d4efa1e5489033e6f8 100644
20--- a/plugins/fzf/fzf.plugin.zsh
21+++ b/plugins/fzf/fzf.plugin.zsh
22@@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() {
23 
24 
25 function fzf_setup_using_debian() {
26-  if (( ! $+commands[dpkg] )); then
27-    # Not a debian based distro
28+  if (( ! $+commands[dpkg] )) || zstyle -t ':omz:plugins:fzf' skip-dpkg; then
29+    # Not a debian based distro 
30     return 1
31   fi
32