From fb2715a43bd8fc35a45ec6c68ae617d917d69237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 22 Oct 2022 11:23:31 +0200 Subject: [PATCH] Apply defaults before loading the theme * This prevents uninitialized values from being used if the user's theme doesn't contain every item we need. --- gprompt.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gprompt.pl b/gprompt.pl index bfee2e5..cc7f208 100644 --- a/gprompt.pl +++ b/gprompt.pl @@ -340,7 +340,11 @@ sub themed($) { my $k = shift; unless ( %THEME ) { - %THEME = ( %{ &load_theme } , %{ $CONFIG{layout_theme_overrides} } ); + %THEME = ( + %{ &default_theme } , + %{ &load_theme } , + %{ $CONFIG{layout_theme_overrides} } + ); my @to_resolve = grep { ref( $THEME{$_} ) eq 'ThemeRef' } keys %THEME; foreach my $k ( @to_resolve ) { theme_resolve( $k );