mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
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()".
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user