Fix trailing whitespaces in fish comp scripts

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2021-07-02 11:20:50 +02:00
parent bd3c9bace2
commit 92df029615
No known key found for this signature in database
GPG key ID: EB145DD938A3CAF2

View file

@ -152,11 +152,11 @@ function __%[1]s_prepare_completions
# We don't need descriptions anyway since there is only a single # We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately. # real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__%[1]s_comp_results[1]) 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 # Fish won't add a space if the completion ends with any
# of the following characters: @=/:., # of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split) 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 # In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion. # by outputting an extra, longer completion.
__%[1]s_debug "Adding second completion to perform nospace directive" __%[1]s_debug "Adding second completion to perform nospace directive"