summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Type/_remote_files6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bb23d17f..4595c56d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-18 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * 40973: Completion/Unix/Type/_remote_files: Fix completion of
+ remote files that start with a hyphen/minus.
+
2017-04-15 Barton E. Schaefer <schaefer@zsh.org>
* 40977: Src/init.c: "emulate" disallows "--help" and "--version"
diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files
index 1e9fed15e..a5fce9afd 100644
--- a/Completion/Unix/Type/_remote_files
+++ b/Completion/Unix/Type/_remote_files
@@ -58,11 +58,13 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
else rempat="${(q)PREFIX%%[^./][^/]#}\*"
fi
+ # remote filenames
remfiles=(${(M)${(f)"$(_call_program files $cmd $cmd_args $host ls -d1FL -- "$rempat" 2>/dev/null)"}%%[^/]#(|/)})
compset -P '*/'
compset -S '/*' || (( ${args[(I)-/]} )) || suf='remote file'
+ # display strings for remote files and directories
remdispf=(${remfiles:#*/})
remdispd=(${(M)remfiles:#*/})
@@ -77,9 +79,9 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
while _tags; do
while _next_label files expl ${suf:-remote directory}; do
[[ -n $suf ]] &&
- compadd "$args[@]" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0
+ compadd "$args[@]" "$expl[@]" -d remdispf -- ${(q)remdispf%[*=|]} && ret=0
compadd ${suf:+-S/} -r "/ \t\n\-" "$args[@]" "$expl[@]" -d remdispd \
- ${(q)remdispd%/} && ret=0
+ -- ${(q)remdispd%/} && ret=0
done
(( ret )) || return 0
done