From 19abff7e02526952c99bad9e0f19e7334388b9e0 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Sun, 22 Sep 2024 08:24:14 +0000 Subject: [PATCH] strip white space from bat opts before checking if empty Co-authored-by: Nobuyoshi Nakada --- lesspipe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lesspipe.sh b/lesspipe.sh index 8c585a2..a279cff 100755 --- a/lesspipe.sh +++ b/lesspipe.sh @@ -454,8 +454,8 @@ has_colorizer () { [[ -z $style ]] && style=plain [[ -z $theme ]] && theme=ansi fi - [[ -n $style ]] && opt+=(--style="${style%% *}") - [[ -n $theme ]] && opt+=(--theme="${theme%%[|&;<>]*}") + style="${style%% *}" theme="${theme%%[|&;<>]*}" + opt+=(${style:+--style="$style"} ${theme:+--theme="$theme"}) opt+=("$COLOR" --paging=never "$1") ;; pygmentize) pygmentize -l "$lang" /dev/null &>/dev/null && opt=(-l "$lang") || opt=(-g)