about summary refs log tree commit diff
path: root/Completion/Core/_path_files
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r--Completion/Core/_path_files9
1 files changed, 8 insertions, 1 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 1744c280b..10fe39869 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -170,7 +170,14 @@ if [[ "$pre[1]" = \~ ]]; then
     realpath="${userdirs[$linepath]%/}/"
   elif (( $+nameddirs[$linepath] )); then
     realpath="${nameddirs[$linepath]%/}/"
-  elif [[ "$linepath" = [-+][0-9]## ]]; then
+  elif [[ "$linepath" = ([-+]|)[0-9]## ]]; then
+    if [[ "$linepath" != [-+]* ]]; then
+      if [[ -o pushdminus ]]; then
+        linepath="-$linepath"
+      else
+        linepath="+$linepath"
+      fi
+    fi
     if [[ "$linepath" = -* ]]; then
       tmp=$(( $#dirstack $linepath ))
     else