nushell/crates/nu-cli/src
Devyn Cairns f65bc97a54
Update config directly at assignment (#13332)
# Description

Allows `Stack` to have a modified local `Config`, which is updated
immediately when `$env.config` is assigned to. This means that even
within a script, commands that come after `$env.config` changes will
always see those changes in `Stack::get_config()`.

Also fixed a lot of cases where `engine_state.get_config()` was used
even when `Stack` was available.

Closes #13324.

# User-Facing Changes
- Config changes apply immediately after the assignment is executed,
rather than whenever config is read by a command that needs it.
- Potentially slower performance when executing a lot of lines that
change `$env.config` one after another. Recommended to get `$env.config`
into a `mut` variable first and do modifications, then assign it back.
- Much faster performance when executing a script that made
modifications to `$env.config`, as the changes are only parsed once.

# Tests + Formatting
All passing.

# After Submitting
- [ ] release notes
2024-07-11 06:09:33 -07:00
..
commands Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
completions Fix variable completion sort order (#13306) 2024-07-05 17:58:35 -05:00
menus Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
config_files.rs Converted perf function to be a macro. Utilized the perf macro within the polars plugin. (#13224) 2024-06-27 18:56:56 -05:00
eval_cmds.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
eval_file.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
lib.rs Change the error style during tests to plain (#13061) 2024-06-18 21:37:24 -07:00
nu_highlight.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
print.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
prompt_update.rs Refactor the CLI code a bit (#12782) 2024-05-10 07:29:27 +08:00
prompt.rs cleanup osc calls for shell_integration (#12810) 2024-05-08 13:34:04 -05:00
reedline_config.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
repl.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
syntax_highlight.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
util.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00