about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-25 18:36:42 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-27 18:13:27 +0000
commit1f00f683670027579b01f8bc1d7b7e2f4496e7b2 (patch)
tree6adfd436ed8b48405f98f24215dbe1bd8104167e
parentb62d9eb63eb5c9a20c4f38a180f339d36c4b5136 (diff)
downloadzsh-1f00f683670027579b01f8bc1d7b7e2f4496e7b2.tar.gz
zsh-1f00f683670027579b01f8bc1d7b7e2f4496e7b2.tar.xz
zsh-1f00f683670027579b01f8bc1d7b7e2f4496e7b2.zip
39105: _hashed_absolute_command_paths: Make the display string the basename.
This makes better use of terminal real estate.
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Type/_absolute_command_paths4
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9dd1ef17d..16d29cb46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2016-08-27  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 39105: Completion/Unix/Type/_absolute_command_paths:
+	_hashed_absolute_command_paths: Make the display string the
+	basename.
+
 	* 39103: Completion/Unix/Type/_absolute_command_paths:
 	_typed-in_absolute_command_paths: Better handle non-empty
 	arguments that don't start with a slash.
diff --git a/Completion/Unix/Type/_absolute_command_paths b/Completion/Unix/Type/_absolute_command_paths
index 4d9f79380..e08ca56df 100644
--- a/Completion/Unix/Type/_absolute_command_paths
+++ b/Completion/Unix/Type/_absolute_command_paths
@@ -7,7 +7,9 @@ _hashed_absolute_command_paths() {
   integer ret=1
   for i in $set_of_dirs_of_hashed_commands
   do
-    compadd -M "l:|=$i" "$expl[@]" -a 'commands[(R)${~i}[^/]#]'
+    local -a matches=( "${(@)commands[(R)${~i}[^/]#]}" )
+    local -a descs=( $matches:t )
+    compadd -M "l:|=$i" -d descs "$expl[@]" -a matches
     ret=0
   done
   return ret