summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-04-27 08:49:11 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-04-27 08:49:11 +0000
commit5d77927ffde695fb659af9d1ce3fb9df5a795179 (patch)
tree086943a99121e6761f2595db08cbf270b66da6fa
parent42771216622146246c94e35e4c9dbc2073e7deda (diff)
downloadzsh-5d77927ffde695fb659af9d1ce3fb9df5a795179.tar.gz
zsh-5d77927ffde695fb659af9d1ce3fb9df5a795179.tar.xz
zsh-5d77927ffde695fb659af9d1ce3fb9df5a795179.zip
27911: no completion colouring with old lists when turned off
-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