mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-20 06:02:46 +08:00
completions: Use commandline -opc, not just -o
`commandline -o` tokenizes *the entire commandline buffer*. See #6922.
This commit is contained in:
parent
2421eb6180
commit
3f95440f26
|
@ -50,7 +50,7 @@ function __fish_complete_npm -d "Complete the commandline using npm's 'completio
|
|||
if command -sq npm
|
||||
# npm completion is bash-centric, so we need to translate fish's "commandline" stuff to bash's $COMP_* stuff
|
||||
# COMP_LINE is an array with the words in the commandline
|
||||
set -lx COMP_LINE (commandline -o)
|
||||
set -lx COMP_LINE (commandline -opc)
|
||||
# COMP_CWORD is the index of the current word in COMP_LINE
|
||||
# bash starts arrays with 0, so subtract 1
|
||||
set -lx COMP_CWORD (math (count $COMP_LINE) - 1)
|
||||
|
|
|
@ -11,7 +11,7 @@ end
|
|||
# Lists PHPUnit objects corresponding to the given option
|
||||
function __fish_phpunit_list --argument option
|
||||
# Use the same PHPUnit binary as in the command being completed
|
||||
set -l phpunit (commandline -o)[1]
|
||||
set -l phpunit (commandline -opc)[1]
|
||||
test -x $phpunit
|
||||
or return
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user