From d56bddf4b1fc343c48bec939fbca8a414f4711f5 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 15 Mar 2017 09:40:22 -0500 Subject: [PATCH] Add coalesce function to git-info that will be used by the minimal theme, and could be used for future themes too. Prezto had this, but we diminished its necessity by simplifying how git-info works. --- modules/git-info/functions/coalesce | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 modules/git-info/functions/coalesce diff --git a/modules/git-info/functions/coalesce b/modules/git-info/functions/coalesce new file mode 100644 index 0000000..e9e838e --- /dev/null +++ b/modules/git-info/functions/coalesce @@ -0,0 +1,6 @@ +# Prints the first non-empty string in the arguments array. +for arg in ${argv}; do + print -n ${arg} + return 0 +done +return 1