mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 19:32:45 +08: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.
This commit is contained in:
parent
6990c44443
commit
1988bd2579
|
@ -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 New Issue
Block a user