From ba8777fc3013a3c682d8144586e16457cbe12586 Mon Sep 17 00:00:00 2001
From: Yuxin Wu <ppwwyyxxc@gmail.com>
Date: Sat, 21 Jan 2023 02:36:07 -0800
Subject: perf(fzf): speed up startup on debian (#11122)

---
 plugins/fzf/fzf.plugin.zsh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'plugins/fzf')

diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 9c8dd8648..85a0bf270 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() {
 
 
 function fzf_setup_using_debian() {
-  if (( ! $+commands[dpkg] )) || ! dpkg -s fzf &>/dev/null; then
-    # Either not a debian based distro, or no fzf installed
+  if (( ! $+commands[dpkg] )); then
+    # Not a debian based distro
     return 1
   fi
 
@@ -72,11 +72,19 @@ function fzf_setup_using_debian() {
 
   case $PREFIX in
     *com.termux*)
+      if [[ ! -f "${PREFIX}/bin/fzf" ]]; then
+        # fzf not installed
+        return 1
+      fi
       # Support Termux package
       completions="${PREFIX}/share/fzf/completion.zsh"
       key_bindings="${PREFIX}/share/fzf/key-bindings.zsh"
       ;;
     *)
+      if [[ ! -f /usr/bin/fzf ]]; then
+        # fzf not installed
+        return 1
+      fi
       # Determine completion file path: first bullseye/sid, then buster/stretch
       completions="/usr/share/doc/fzf/examples/completion.zsh"
       [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"
-- 
cgit v1.2.3-70-g09d2


From a1c54e03f98b594a6fcc368c2c113d469ffaa368 Mon Sep 17 00:00:00 2001
From: Carlo Sala <carlosalag@protonmail.com>
Date: Sun, 22 Jan 2023 23:36:57 +0100
Subject: feat(fzf): add `skip-dpkg` flag to avoid some regressions

See https://github.com/ohmyzsh/ohmyzsh/pull/11122#issuecomment-1399607430
---
 plugins/fzf/README.md      | 9 +++++++++
 plugins/fzf/fzf.plugin.zsh | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

(limited to 'plugins/fzf')

diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md
index beedf4690..7e3e3e5b0 100644
--- a/plugins/fzf/README.md
+++ b/plugins/fzf/README.md
@@ -50,3 +50,12 @@ Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C):
 ```zsh
 DISABLE_FZF_KEY_BINDINGS="true"
 ```
+
+### Skip `dpkg` loading
+
+If you have `dpkg` available in your `$PATH` but you don't want to load `fzf` from there, and facing some
+issues, you can define this option before loading `oh-my-zsh` in order to skip that loading:
+
+```zsh
+zstyle ':omz:plugins:fzf' skip-dpkg yes
+```
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 85a0bf270..c07d38493 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -60,8 +60,8 @@ function fzf_setup_using_base_dir() {
 
 
 function fzf_setup_using_debian() {
-  if (( ! $+commands[dpkg] )); then
-    # Not a debian based distro
+  if (( ! $+commands[dpkg] )) || zstyle -t ':omz:plugins:fzf' skip-dpkg; then
+    # Not a debian based distro 
     return 1
   fi
 
-- 
cgit v1.2.3-70-g09d2


From b0bffcaf865434711d98b63eddd0aa52be0fbeb1 Mon Sep 17 00:00:00 2001
From: Marc Cornellà <hello@mcornella.com>
Date: Fri, 27 Jan 2023 16:22:27 +0100
Subject: fix(fzf): fix check for true Debian-like in debian setup function
 (#11460)

Check for `apt` and `apt-get` in debian setup function.
Look for exact directory in debian-like setup function.

Fixes #11459
---
 plugins/fzf/README.md      | 9 ---------
 plugins/fzf/fzf.plugin.zsh | 4 ++--
 2 files changed, 2 insertions(+), 11 deletions(-)

(limited to 'plugins/fzf')

diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md
index 7e3e3e5b0..beedf4690 100644
--- a/plugins/fzf/README.md
+++ b/plugins/fzf/README.md
@@ -50,12 +50,3 @@ Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C):
 ```zsh
 DISABLE_FZF_KEY_BINDINGS="true"
 ```
-
-### Skip `dpkg` loading
-
-If you have `dpkg` available in your `$PATH` but you don't want to load `fzf` from there, and facing some
-issues, you can define this option before loading `oh-my-zsh` in order to skip that loading:
-
-```zsh
-zstyle ':omz:plugins:fzf' skip-dpkg yes
-```
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index c07d38493..7bb6667d0 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -60,7 +60,7 @@ function fzf_setup_using_base_dir() {
 
 
 function fzf_setup_using_debian() {
-  if (( ! $+commands[dpkg] )) || zstyle -t ':omz:plugins:fzf' skip-dpkg; then
+  if (( ! $+commands[apt] && ! $+commands[apt-get] )); then
     # Not a debian based distro 
     return 1
   fi
@@ -81,7 +81,7 @@ function fzf_setup_using_debian() {
       key_bindings="${PREFIX}/share/fzf/key-bindings.zsh"
       ;;
     *)
-      if [[ ! -f /usr/bin/fzf ]]; then
+      if [[ ! -d /usr/share/doc/fzf/examples ]]; then
         # fzf not installed
         return 1
       fi
-- 
cgit v1.2.3-70-g09d2


From 3e1c0d51cb66cf02357b25f514d55a3de8197647 Mon Sep 17 00:00:00 2001
From: GrandZhuo <lizhuo93@foxmail.com>
Date: Sun, 12 Feb 2023 16:53:04 +0800
Subject: fix(fzf): installation dir for brew M1 (#11490)

---
 plugins/fzf/fzf.plugin.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'plugins/fzf')

diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 7bb6667d0..b253a23d2 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -9,7 +9,7 @@ function fzf_setup_using_base_dir() {
       "${HOME}/.nix-profile/share/fzf"
       "${XDG_DATA_HOME:-$HOME/.local/share}/fzf"
       "/usr/local/opt/fzf"
-      "/opt/homebrew/bin/fzf"
+      "/opt/homebrew/opt/fzf"
       "/usr/share/fzf"
       "/usr/local/share/examples/fzf"
     )
-- 
cgit v1.2.3-70-g09d2