public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect:nolinewrap commit in: libs/
@ 2013-11-14 23:56 Ulrich Müller
  0 siblings, 0 replies; only message in thread
From: Ulrich Müller @ 2013-11-14 23:56 UTC (permalink / raw
  To: gentoo-commits

commit:     c63f4fd00866485ee8c7ab95ab17733cc25aaba9
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 14 23:56:22 2013 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Nov 14 23:56:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=c63f4fd0

More cosmetic changes in output.bash.

---
 libs/output.bash.in | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/libs/output.bash.in b/libs/output.bash.in
index 78e0c4f..5390792 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -90,6 +90,7 @@ write_kv_list_entry() {
 	local n text key val lindent rindent
 	local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT}
 	local normal=${COLOUR_NORMAL}
+	local cols=${COLUMNS:-80}
 	local IFS=$' \t\n'
 
 	if [[ $1 == "-p" ]]; then
@@ -117,19 +118,15 @@ write_kv_list_entry() {
 		n=$(( 28 + ${#rindent} ))
 	fi
 
-	space ${n}
-	echo -n -e "${right}"
+	echo -n -e "$(space ${n})${right}"
 	n=$(( 28 + ${#rindent} ))
 
-	local cols=${COLUMNS:-80}
-	local cwords=$(apply_text_highlights "${right}" "${val}")
-
 	text=${val//\%%%??%%%/}
 	# only loop if it doesn't fit on the same line
 	if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then
 		local i=0 spc=""
 		rindent=$(space ${n})
-		cwords=( ${cwords} )
+		local cwords=( $(apply_text_highlights "${right}" "${val}") )
 		for text in ${val}; do
 			text=${text//\%%%??%%%/}
 			# put the word on the same line if it fits
@@ -141,11 +138,11 @@ write_kv_list_entry() {
 				echo -n -e "\n${rindent}${cwords[i]}"
 				n=$(( ${#rindent} + ${#text} ))
 			fi
-			i=$(( ${i} + 1 ))
+			(( i++ ))
 			spc=" "
 		done
 	else
-		echo -n -e "${cwords}"
+		echo -n -e "$(apply_text_highlights "${right}" "${val}")"
 	fi
 	echo -e "${normal}"
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-14 23:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 23:56 [gentoo-commits] proj/eselect:nolinewrap commit in: libs/ Ulrich Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox