summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-16 10:45:01 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-16 10:45:01 +0000
commitaa17f0db6d4dc751a636ca150f9b7942da3f6885 (patch)
tree8fc7d89b9ae48dca2a58eaf0e562bdda3ba88461 /Completion
parent7a53d36f394e6a5dddc7cf2cc893a82502b4c4bc (diff)
downloadzsh-aa17f0db6d4dc751a636ca150f9b7942da3f6885.tar.gz
zsh-aa17f0db6d4dc751a636ca150f9b7942da3f6885.tar.xz
zsh-aa17f0db6d4dc751a636ca150f9b7942da3f6885.zip
fix scrolling in menu-selection with matches spanning multiple lines
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Core/_expand12
1 files changed, 10 insertions, 2 deletions
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 987a597c7..8bf6d11f4 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -108,9 +108,17 @@ if [[ -z "$compstate[insert]" ]] ;then
 else
   _tags all-expansions expansions original
 
-  _requested all-expansions expl 'all expansions' &&
-      compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
+  if _requested all-expansions expl 'all expansions'; then
+    local disp dstr
 
+    if [[ $#exp -ge COLUMNS ]]; then
+      disp=( -ld dstr )
+      dstr=( "${(r:COLUMNS-5:)exp} ..." )
+    else
+      disp=()
+    fi
+    compadd "$disp[@]" "$expl[@]" -UQ -qS "$suf" - "$exp"
+  fi
   if [[ $#exp -gt 1 ]] && _requested expansions; then
     local i normal dir