summary refs log tree commit diff
path: root/Completion/Zsh/Command/_fc
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-11-05 00:30:42 +0100
committerOliver Kiddle <opk@zsh.org>2016-11-05 00:31:01 +0100
commit5c28031ea6f0095aa80afa56c3264c6cc5f36fbb (patch)
tree46849487bb2aee2ba62e98d08e7019d3c13ceda4 /Completion/Zsh/Command/_fc
parent4b41e33cbcf8027b53ecae4467dc9232becb0420 (diff)
downloadzsh-5c28031ea6f0095aa80afa56c3264c6cc5f36fbb.tar.gz
zsh-5c28031ea6f0095aa80afa56c3264c6cc5f36fbb.tar.xz
zsh-5c28031ea6f0095aa80afa56c3264c6cc5f36fbb.zip
39834: when print used with -v and -l, include a final newline
Also complete print -S option and make further use of the
new printf to an array feature in other completion functions.
Diffstat (limited to 'Completion/Zsh/Command/_fc')
-rw-r--r--Completion/Zsh/Command/_fc5
1 files changed, 3 insertions, 2 deletions
diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc
index b90436a01..6cc01f32d 100644
--- a/Completion/Zsh/Command/_fc
+++ b/Completion/Zsh/Command/_fc
@@ -1,7 +1,8 @@
 #compdef fc history r
 
 local curcontext="$curcontext" state state_descr line ret=1
-local events num cmd sep
+local num cmd sep
+local -a events
 typeset -A opt_args
 local fc_common fc_hist fc_r
 
@@ -71,7 +72,7 @@ if [[ -n $state ]]; then
   if [[ -z ${line:#*=*} ]] && compset -P 1 '*='; then
     _message -e replacements 'replacement'
   elif [[ -prefix [0-9] ]]; then
-    events=( ${(0)"$(printf "%-${#HISTNO}.${#HISTNO}s $sep %s\0" "${(kv)history[@]}")"} )
+    print -v events -f "%-${#HISTNO}.${#HISTNO}s $sep %s" "${(kv)history[@]}"
     _wanted -2V events expl "$state_descr" compadd -M "B:0=" -ld events - \
         "${events[@]%% *}"
   elif [[ -prefix - ]]; then