mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
Fix completions if previous arg is a variable
complete -C'echo $HOM ' would complete $HOM instead of a new token.
Fixes another regression introduced in
6fb7f9b6b - Fix completion for builtins with subcommands
This commit is contained in:
@@ -1502,8 +1502,10 @@ void completer_t::perform() {
|
||||
// If we are completing a variable name or a tilde expansion user name, we do that and return.
|
||||
// No need for any other completions.
|
||||
const wcstring current_token = cur_tok.get_source(cmd);
|
||||
if (try_complete_variable(current_token) || try_complete_user(current_token)) {
|
||||
return;
|
||||
if (cur_tok.location_in_or_at_end_of_source_range(cursor_pos)) {
|
||||
if (try_complete_variable(current_token) || try_complete_user(current_token)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd_tok.location_in_or_at_end_of_source_range(cursor_pos)) {
|
||||
|
||||
@@ -165,3 +165,6 @@ end
|
||||
complete -c complete_test_function_desc -xa '(complete -Csome_function)'
|
||||
complete -C'complete_test_function_desc ' | count
|
||||
# CHECK: 1
|
||||
|
||||
complete -c prev-arg-variable -f
|
||||
complete -C'prev-arg-variable $HOME '
|
||||
|
||||
Reference in New Issue
Block a user