Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/namespaces/autocomplete/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var autocompleteScripts = map[string]autocompleteScript{
_scw() {
_get_comp_words_by_ref -n = cword words

output=$(scw autocomplete complete bash "$COMP_LINE" "$cword" "${words[@]}")
output=$(scw autocomplete complete bash -- "$COMP_LINE" "$cword" "${words[@]}")
COMPREPLY=($output)
# apply compopt option and ignore failure for older bash versions
[[ $COMPREPLY == *= ]] && compopt -o nospace 2> /dev/null || true
Expand Down Expand Up @@ -82,7 +82,7 @@ var autocompleteScripts = map[string]autocompleteScript{
CompleteFunc: `
complete --erase --command scw;
complete --command scw --no-files;
complete --command scw --arguments '(scw autocomplete complete fish (commandline) (commandline --cursor) (commandline --current-token) (commandline --tokenize --cut-at-cursor))';
complete --command scw --arguments '(scw autocomplete complete fish -- (commandline) (commandline --cursor) (commandline --current-token) (commandline --tokenize --cut-at-cursor))';
`,
CompleteScript: `eval (scw autocomplete script shell=fish)`,
ShellConfigurationFile: map[string]string{
Expand Down Expand Up @@ -110,7 +110,7 @@ var autocompleteScripts = map[string]autocompleteScript{
# we replace 'EMPTY_WORD' by '' later in go code
words+=('EMPTY_WORD')
fi
output=($(scw autocomplete complete zsh $CURSOR $words))
output=($(scw autocomplete complete zsh -- $CURSOR $words))
opts=('-S' ' ')
if [[ $output == *= ]]; then
opts=('-S' '')
Expand Down