about summary refs log tree commit diff
path: root/Completion/Builtins
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Builtins')
-rw-r--r--Completion/Builtins/_zstyle27
1 files changed, 18 insertions, 9 deletions
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle
index 9d77612fc..328e2d7d2 100644
--- a/Completion/Builtins/_zstyle
+++ b/Completion/Builtins/_zstyle
@@ -30,7 +30,7 @@ styles=(
   hidden		 c:bool
   hosts			 c:_hosts
   hosts-ports		 c:host-port
-  hosts-ports-users	 c:host-port-user
+  users-hosts-ports	 c:user-host-port
   ignore-parents         c:ignorepar
   ignored-patterns	 c:
   insert-unambiguous	 c:bool
@@ -155,15 +155,24 @@ while [[ -n $state ]]; do
           _expand _list _menu _oldlist
       ;;
 
-    host-port*)
+    user-host-port)
+      if [[ $PREFIX != *[@:]* ]]; then
+	_users -S @
+      elif [[ $PREFIX = *[@:]*[[@:]* ]]; then
+	compset -P 2 '*[:@]'
+	_ports
+      else
+	compset -P 1 '*[:@]'
+	_hosts -S :
+      fi
+      ;;
+
+    host-port)
       if [[ $PREFIX != *:* ]]; then
 	_hosts -S :
-      elif [[ $ostate != *user || $PREFIX != *:*:* ]]; then
+      else
 	compset -P 1 '*:'
 	_ports
-      else
-	compset -P 2 '*:'
-        _users
       fi
       ;;
 
@@ -197,11 +206,11 @@ while [[ -n $state ]]; do
       ;;
 
     user-host)
-      if [[ $PREFIX = *:* ]]; then
-	compset -P '*:'
+      if [[ $PREFIX = *[@:]* ]]; then
+	compset -P '*[@:]'
 	_hosts
       else
-	_users
+	_users -S @
       fi
       ;;