From 398fc17b81ed4e875bacc58045cd469940fedb50 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 29 Apr 2026 14:37:43 +0800 Subject: [PATCH] reader: use simpler test environment constructor A following commit wants to pass parser by exclusive reference, which disallows passing "parser" as well as "parser.vars()" in one function call. This use case also doesn't make sense. The "OperationContext::test_only_foreground" constructor is used to inject a special "PwdEnvironment" into the context. When we don't need this environment, we can use a regular constructor, which already uses "parser.vars()". --- src/reader/reader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reader/reader.rs b/src/reader/reader.rs index b6859a546..171123968 100644 --- a/src/reader/reader.rs +++ b/src/reader/reader.rs @@ -7302,10 +7302,10 @@ macro_rules! validate { let mut cursor_pos = in_cursor_pos; let result = completion_apply_to_command_line( - &OperationContext::test_only_foreground( + &OperationContext::foreground( &parser, - parser.vars(), Box::new(no_cancel), + crate::operation_context::EXPANSION_LIMIT_DEFAULT, ), completion, $flags,