summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-06-04 09:33:13 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-06-04 09:33:13 +0000
commit61b27ae46197c65db401490052beb0d7f3a5758b (patch)
tree31aa1bb608904d5a02627fdfd377aaaf5fd74edb
parenta78b220462b8b13e4cd814937650a27234009cb2 (diff)
downloadzsh-61b27ae46197c65db401490052beb0d7f3a5758b.tar.gz
zsh-61b27ae46197c65db401490052beb0d7f3a5758b.tar.xz
zsh-61b27ae46197c65db401490052beb0d7f3a5758b.zip
25130 with typos fixed: use compad -U in _path_files to fix problem
with spelling correction of path prefixes
-rw-r--r--ChangeLog9
-rw-r--r--Completion/Unix/Type/_path_files22
2 files changed, 23 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 344f1c6c9..5e25016ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-04  Peter Stephenson  <pws@csr.com>
+
+	* 25130 slightly tweaked for typos:
+	Completion/Unix/Type/_path_files: changes to use -U flag
+	to compadd so that spelling corrections in non-final
+	path segments are accepted.
+
 2008-06-03  Peter Stephenson  <pws@csr.com>
 
 	* 25132: Completion/Zsh/Command/_zstyle: numerous still
@@ -16,7 +23,7 @@
 
 2008-06-01  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
-	* 25127: README: note the changes in 25124 and 25126 as
+	* 25127: README: note the changes in 25122, 25124 and 25126 as
 	an incompatibility.
 
 2008-06-01  Clint Adams  <clint@zsh.org>
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index fc0789f01..a3e19ac53 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -595,7 +595,8 @@ for prepath in "$prepaths[@]"; do
 	    # back up the path.
 	    tmp1=("${(@)tmp1%%/*}")
 	    _list_files tmp1 "$prepath$realpath$testpath"
-	    compadd -Qf "$mopts[@]" -p "$linepath$tmp2" -s "/${tmp3#*/}" \
+	    compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2"
+	            -s "/${tmp3#*/}$ISUFFIX" \
 	            -W "$prepath$realpath$testpath" \
 		    "$pfxsfx[@]" -M "r:|/=* r:|=*" \
 		    $listopts \
@@ -604,7 +605,8 @@ for prepath in "$prepaths[@]"; do
 	    # Same with a non-empty suffix
 	    tmp1=("${(@)^tmp1%%/*}/${tmp3#*/}")
 	    _list_files tmp1 "$prepath$realpath$testpath"
-	    compadd -Qf "$mopts[@]" -p "$linepath$tmp2" \
+	    compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	            -s "$ISUFFIX" \
 	            -W "$prepath$realpath$testpath" \
 		    "$pfxsfx[@]" -M "r:|/=* r:|=*" \
 	            $listopts \
@@ -612,7 +614,8 @@ for prepath in "$prepaths[@]"; do
           fi
 	else
 	  _list_files tmp1 "$prepath$realpath$testpath"
-	  compadd -Qf "$mopts[@]" -p "$linepath$tmp2" \
+	  compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	          -s "$ISUFFIX" \
 	          -W "$prepath$realpath$testpath" \
 		   "$pfxsfx[@]" -M "r:|/=* r:|=*" \
 	           $listopts \
@@ -621,7 +624,8 @@ for prepath in "$prepaths[@]"; do
       else
 	# We are inserting the match into the command line.
         if [[ "$tmp3" = */* ]]; then
-	  tmp4=( -Qf "$mopts[@]" -p "$linepath$tmp2"
+	  tmp4=( -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2"
+	         -s "$ISUFFIX"
 	         -W "$prepath$realpath$testpath"
 	         "$pfxsfx[@]" -M "r:|/=* r:|=*" )
 	  if [[ -z "$listsfx" ]]; then
@@ -640,7 +644,8 @@ for prepath in "$prepaths[@]"; do
           fi
         else
 	  _list_files tmp1 "$prepath$realpath$testpath"
-	  compadd -Qf "$mopts[@]" -p "$linepath$tmp2" \
+	  compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	          -s "$ISUFFIX" \
                   -W "$prepath$realpath$testpath" \
 		  "$pfxsfx[@]" -M "r:|/=* r:|=*" \
                   $listopts \
@@ -708,7 +713,8 @@ for prepath in "$prepaths[@]"; do
       compquote tmp4 tmp2 tmp1
       for i in "$tmp1[@]"; do
 	_list_files tmp2 "$prepath$realpath${mid%/*/}"
-        compadd -Qf "$mopts[@]" -p "$linepath$tmp3/" -s "/$tmp4$i" \
+        compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp3/" \
+	        -s "/$tmp4$i$ISUFFIX" \
                 -W "$prepath$realpath${mid%/*/}/" \
 	        "$pfxsfx[@]" -M "r:|/=* r:|=*" $listopts - "$tmp2"
       done
@@ -738,7 +744,9 @@ for prepath in "$prepaths[@]"; do
       else
 	# Not a pattern match
 	_list_files tmp1 "$prepath$realpath$testpath"
-        compadd -Qf -p "$linepath$tmp4" -W "$prepath$realpath$testpath" \
+        compadd -U -Qf -p "$IPREFIX$linepath$tmp4" \
+	        -s "$ISUFFIX" \
+	        -W "$prepath$realpath$testpath" \
 	        "$pfxsfx[@]" "$mopts[@]" -M "r:|/=* r:|=*" $listopts -a tmp1
       fi
     fi