From a39592cdc544d608519796bdd1916ac68bb74832 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 2 Aug 2016 23:11:00 +1000 Subject: [PATCH] Line wrap changes --- config/config | 4 ---- neofetch | 13 ++++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config/config b/config/config index 6a491572..c6d5b8c8 100644 --- a/config/config +++ b/config/config @@ -212,10 +212,6 @@ colors=(distro) # Text Options {{{ -# Toggle line wrapping -# --line_wrap on/off -line_wrap="off" - # Toggle bold text # --bold on/off bold="on" diff --git a/neofetch b/neofetch index f84d71e1..25a4e7f0 100755 --- a/neofetch +++ b/neofetch @@ -217,10 +217,6 @@ colors=(distro) # Text Options {{{ -# Toggle line wrapping -# --line_wrap on/off -line_wrap="off" - # Toggle bold text # --bold on/off bold="on" @@ -2486,6 +2482,14 @@ info () { # Trim whitespace output="$(trim "$output")" + # Fix rendering issues with w3m and lines that + # wrap to the next line by adding a max line + # length. + if [ "$image" != "off" ] && [ "$image" != "ascii" ] && [ "$1" != "cols" ]; then + padding_num="${padding/\\033\[}" + output="$(printf "%.$((columns - ${padding_num/C} - gap - ${#subtitle}))s" "$output")" + fi + case "$1" in title) string="${title_color}${bold}${output}" @@ -2999,7 +3003,6 @@ usage () { cat << EOF title, @, underline, subtitle, colon, info --underline on/off enable/disable the underline. --underline_char char Character to use when underlining title - --line_wrap on/off Enable/Disable line wrapping --bold on/off Enable/Disable bold text