From da0acb28ba1414aa06c026bb58e7df74473c2362 Mon Sep 17 00:00:00 2001 From: Collin Styles Date: Tue, 13 Oct 2020 23:26:53 -0700 Subject: [PATCH] Don't chomp `foo=` when completing `foo=br` `complete_param_expand` knows how to handle cases like `foo=br` so we don't need to bother sending just the `br` part. Furthermore, sending just `br` is incorrect because we will end up replacing the entirety of `foo=br` with the result of the completion. That is, `foo=br` will be replaced with `bar` instead of being completed to `foo=bar`. --- src/complete.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/complete.cpp b/src/complete.cpp index 7f4f22f71..106923e54 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1622,7 +1622,7 @@ void completer_t::perform_for_commandline(wcstring cmdline) { if (cmd_tok.location_in_or_at_end_of_source_range(cursor_pos)) { maybe_t equal_sign_pos = variable_assignment_equals_pos(current_token); if (equal_sign_pos) { - complete_param_expand(current_token.substr(*equal_sign_pos + 1), true /* do_file */); + complete_param_expand(current_token, true /* do_file */); return; } // Complete command filename.