Commits

Shlomi Fish  committed c839984

Made sure one can reload the configuration.

  • Participants
  • Parent commits a879b30

Comments (0)

Files changed (1)

File shlomif-settings/Bash/Themes/Source-Me.bash

     source "$filename"
 }
 
+__theme_completion_commands=''
+
+function __reload_themes_completion
+{
+    for cmd in $__theme_completion_commands ; do
+        complete -W "$(cat ${__themes_dir}/list-of-themes.txt)" "$cmd"
+    done
+}
+
 function __complete_with_themes
 {
     cmd="$1"
     shift
 
-    complete -W "$(cat ${__themes_dir}/list-of-themes.txt)" "$cmd"
+    # Uniqify them.
+    __theme_completion_commands="$(echo "$__theme_completion_commands $cmd" |perl -0777 -pe 's/\s+/\n/g' | sort | uniq)"
+
+    __reload_themes_completion
 }
 
 __complete_with_themes "Theme"