mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-30 14:53:11 +00:00
completions/git: Only use first line of alias as the description
This was a weird one. We split the aliases correctly even with
multiple lines, but then broke it all again when we just printed the
description.
Note that it would be possible to use `string split0` here, but since
anything longer than a line is likely too long for a description
anyway we don't bother.
Fixes #6946.
(cherry picked from commit 1988bd2579
)
This commit is contained in:
parent
1643cf40fb
commit
6c4cf69110
1 changed files with 3 additions and 1 deletions
|
@ -621,7 +621,9 @@ function __fish_git_aliases
|
|||
__fish_git config -z --get-regexp '^alias\.' 2>/dev/null | while read -lz key value
|
||||
begin
|
||||
set -l name (string replace -r '^.*\.' '' -- $key)
|
||||
printf "%s\t%s\n" $name "Alias for $value"
|
||||
# Only use the first line of the value as the description.
|
||||
set -l val (printf '%s\n' $value)[1]
|
||||
printf "%s\t%s\n" $name "Alias for $val"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue