completions: fix some completions to not look at other commands on the command line

This commit is contained in:
Johannes Altmanninger
2024-01-07 18:04:53 +01:00
parent d71aae7d3b
commit 57d7c46d22
3 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ function __fish_complete_clang
set -l prefix (commandline -ct | string replace -fr -- '^(.*=)[^=]*' '$1')
# Don't hard-code the name of the clang binary
set -l clang (commandline -o)[1]
set -l clang (commandline -op)[1]
# first get the completions from clang, with the prefix separated from the value by a comma
$clang --autocomplete=(commandline -ct | string unescape | string replace -- "$prefix" "$prefix,") 2>/dev/null |
# and put it in a format that fish understands