From 4157ca711da6d125d21826cc463f8ad73102cd25 Mon Sep 17 00:00:00 2001 From: Piotr Kufel Date: Thu, 1 Aug 2024 02:17:58 -0700 Subject: [PATCH] Factor out style-setting code (#13406) # Description This is mainly cleanup, but introduces a slight (positive, if anything) behavior change: Some menu layouts support only a subset of styles, but with this change the user will still be able to configure them. This seems strictly better - if reedline starts supporting one of the existing styles for a particular layout, there won't be any need to update nushell code. # User-Facing Changes None # Tests + Formatting This is simply factoring out existing code, old tests should still cover it. --------- Co-authored-by: sholderbach --- crates/nu-cli/src/reedline_config.rs | 87 +++++++++------------------- 1 file changed, 27 insertions(+), 60 deletions(-) diff --git a/crates/nu-cli/src/reedline_config.rs b/crates/nu-cli/src/reedline_config.rs index d5d3272bc1..63d88316df 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -193,6 +193,29 @@ fn get_style(record: &Record, name: &str, span: Span) -> Option