From 1fc1b459eefa8fcb862a79a90cf9543aa18d9fc4 Mon Sep 17 00:00:00 2001
From: Sorin Ionescu <sorin.ionescu@gmail.com>
Date: Mon, 26 Dec 2011 13:37:54 -0500
Subject: [PATCH] The theme should manage the completion indicator.

---
 keyboard.zsh                    | 22 ++++++++++------------
 templates/zshrc.zsh             |  3 ---
 themes/sorin/prompt_sorin_setup |  2 +-
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/keyboard.zsh b/keyboard.zsh
index 8867e7cd..2eaa68c0 100644
--- a/keyboard.zsh
+++ b/keyboard.zsh
@@ -9,7 +9,7 @@ fi
 zstyle ':omz:prompt' vicmd '<<<'
 
 # Indicator to notify of generating completion.
-zstyle ':omz:completion:indicator' format "..."
+zstyle ':omz:completion' indicator '...'
 
 # Beep on error in line editor.
 setopt BEEP
@@ -258,15 +258,13 @@ if zstyle -t ':omz:editor' dot-expansion; then
 fi
 
 # Display an indicator when completing.
-if zstyle -t ':omz:completion:indicator' enable; then
-  function expand-or-complete-prefix-with-indicator() {
-    zstyle -s ':omz:completion:indicator' format indicator
-    print -Pn "$indicator"
-    unset indicator
-    zle expand-or-complete-prefix
-    zle redisplay
-  }
-  zle -N expand-or-complete-prefix-with-indicator
-  bindkey "$keyinfo[Control]i" expand-or-complete-prefix-with-indicator
-fi
+function expand-or-complete-prefix-with-indicator() {
+  local indicator
+  zstyle -s ':omz:completion' indicator 'indicator'
+  print -Pn "$indicator"
+  zle expand-or-complete-prefix
+  zle redisplay
+}
+zle -N expand-or-complete-prefix-with-indicator
+bindkey "$keyinfo[Control]i" expand-or-complete-prefix-with-indicator
 
diff --git a/templates/zshrc.zsh b/templates/zshrc.zsh
index be3885c4..3ec7ea02 100644
--- a/templates/zshrc.zsh
+++ b/templates/zshrc.zsh
@@ -13,9 +13,6 @@ zstyle ':omz:*:*' color 'yes'
 # Auto set the tab and window titles.
 zstyle ':omz:terminal' auto-title 'yes'
 
-# Indicate that completions are being generated.
-zstyle ':omz:completion:indicator' enable 'no'
-
 # Set the plugins to load (see $OMZ/plugins/).
 zstyle ':omz:load' plugin 'archive' 'git'
 
diff --git a/themes/sorin/prompt_sorin_setup b/themes/sorin/prompt_sorin_setup
index 9120b4e4..b77c988c 100644
--- a/themes/sorin/prompt_sorin_setup
+++ b/themes/sorin/prompt_sorin_setup
@@ -22,7 +22,7 @@ function prompt_sorin_setup() {
   autoload -Uz add-zsh-hook
   add-zsh-hook precmd prompt_sorin_precmd
 
-  zstyle ':omz:completion:indicator' format '%B%F{red}...%f%b'
+  zstyle ':omz:completion' indicator '%B%F{red}...%f%b'
   zstyle ':omz:prompt' vicmd '%F{yellow}❮%f%B%F{red}❮%f%b%F{red}❮%f'
   zstyle ':omz:plugin:git:prompt' action ':%%B%F{yellow}%s%f%%b'
   zstyle ':omz:plugin:git:prompt' added ' %%B%F{green}✚%f%%b'