From 63abb62b292b6d420fea26da9a691b05580a01e4 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 15 Oct 2022 18:39:16 +0200 Subject: [PATCH] fix dirstack colors Correct alternating of dark/lite colors on plugs. --- dotmatrix.theme | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dotmatrix.theme b/dotmatrix.theme index 2b9af07..0dcdb6f 100644 --- a/dotmatrix.theme +++ b/dotmatrix.theme @@ -268,14 +268,12 @@ _lp_dotmatrix_theme_prompt() { header+="${_DOTMATRIX_PATH} " if _lp_dirstack; then + # Pseudo-recall the path section format. + lp_terminal_format ${DOTMATRIX_COLOR_DARK[@]+"${DOTMATRIX_COLOR_DARK[@]}"} __dotmatrix_make_sep_plug ${DOTMATRIX_COLOR_LITE[@]+"${DOTMATRIX_COLOR_LITE[@]}"} header+="${dotmatrix_sep}" __dotmatrix_make_field "$lp_dirstack" ${DOTMATRIX_COLOR_LITE[@]+"${DOTMATRIX_COLOR_LITE[@]}"} header+="${dotmatrix_field}" - else - # Recall a dark format to correctly reset sections history - # to match the path's section colors. - lp_terminal_format ${DOTMATRIX_COLOR_DARK[@]+"${DOTMATRIX_COLOR_DARK[@]}"} fi #################################################################### @@ -379,6 +377,14 @@ _lp_dotmatrix_theme_prompt() { fi # Final assembling + if _lp_dirstack; then + lp_terminal_format ${DOTMATRIX_COLOR_LITE[@]+"${DOTMATRIX_COLOR_LITE[@]}"} + else + # Recall a dark format to correctly reset sections history + # to match the path's section colors. + lp_terminal_format ${DOTMATRIX_COLOR_DARK[@]+"${DOTMATRIX_COLOR_DARK[@]}"} + fi + __dotmatrix_make_sep_last "$has_notes" header+="$dotmatrix_sep"