summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Type/_list_files8
1 files changed, 8 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_list_files b/Completion/Unix/Type/_list_files
index 5e745d9d1..3d5281669 100644
--- a/Completion/Unix/Type/_list_files
+++ b/Completion/Unix/Type/_list_files
@@ -48,6 +48,13 @@ done
 
 zmodload -i zsh/stat 2>/dev/null || return 1
 
+# Enable stat temporarily if disabled to avoid clashes.
+integer disable_stat
+if [[ ${builtins[stat]} != defined ]]; then
+  (( disable_stat = 1 ))
+  enable stat
+fi
+
 dir=${2:+$2/}
 dir=${(Q)dir}
 
@@ -66,4 +73,5 @@ done
 
 (( ${#listfiles} )) && listopts=(-d listfiles -l -o)
 
+(( disable_stat )) && disable stat
 return 0