Skip to content

Commit

Permalink
Fix trailing whitespaces in fish comp scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed Jul 2, 2021
1 parent 94ee3fa commit 9b30269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fish_completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ function __%[1]s_prepare_completions
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__%[1]s_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__%[1]s_debug "Adding second completion to perform nospace directive"
Expand Down

0 comments on commit 9b30269

Please sign in to comment.