summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Base/Core/_main_complete9
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1695f429c..6bb1c95c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-27  Peter Stephenson  <pws@csr.com>
+
+	* 27911: Completion/Base/Core/_main_complete: ensure colouring is
+	not used if not configured when showing old lists.
+
 2010-04-26  Frank Terbeck  <ft@bewatermyfriend.org>
 
 	* 27908: Functions/VCS_Info/vcs_info: Avoid locale related
@@ -13073,5 +13078,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4966 $
+* $Revision: 1.4967 $
 *****************************************************
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index a2bf8e144..c7d0d5f4d 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -30,7 +30,8 @@ local func funcs ret=1 tmp _compskip format nm call match min max i num\
       _saved_lastprompt="${compstate[last_prompt]}" \
       _saved_list="${compstate[list]}" \
       _saved_insert="${compstate[insert]}" \
-      _saved_colors="$ZLS_COLORS"
+      _saved_colors="$ZLS_COLORS" \
+      _saved_colors_set=${+ZLS_COLORS}
 
 # _precommand sets this to indicate we are following a precommand modifier
 local -a precommands
@@ -325,7 +326,11 @@ fi
     compstate[list]="${compstate[list]//messages} force"
 
 if [[ "$compstate[old_list]" = keep ]]; then
-  ZLS_COLORS="$_saved_colors"
+  if [[ $_saved_colors_set = 1 ]]; then
+    ZLS_COLORS="$_saved_colors"
+  else
+    unset ZLS_COLORS
+  fi
 elif (( $#_comp_colors )); then
   ZLS_COLORS="${(j.:.)_comp_colors}"
 else