summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Common
diff options
context:
space:
mode:
authorLeo Zhang <leo@leozhang.me>2021-08-08 22:14:55 -0700
committerLeo Zhang <leo@leozhang.me>2021-08-08 22:14:55 -0700
commit0b1ad269d109ec46e32910a09339832181e4eb43 (patch)
treedb7fedc36ad1a78464ed2919b4295b37232ed547 /src/Xmobar/Plugins/Monitors/Common
parent4eb262c3e3fb2db3e4e68be17613a51c764f0b00 (diff)
downloadxmobar-0b1ad269d109ec46e32910a09339832181e4eb43.tar.gz
xmobar-0b1ad269d109ec46e32910a09339832181e4eb43.tar.bz2
fix: padString should not make strings longer
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Common')
-rw-r--r--src/Xmobar/Plugins/Monitors/Common/Output.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Output.hs b/src/Xmobar/Plugins/Monitors/Common/Output.hs
index 3c18e87..248f276 100644
--- a/src/Xmobar/Plugins/Monitors/Common/Output.hs
+++ b/src/Xmobar/Plugins/Monitors/Common/Output.hs
@@ -140,7 +140,7 @@ showWithUnits d n x
padString :: Int -> Int -> String -> Bool -> String -> String -> String
padString mnw mxw pad pr ellipsis s =
let len = length s
- rmin = if mnw <= 0 then 1 else mnw
+ rmin = if mnw < 0 then 0 else mnw
rmax = if mxw <= 0 then max len rmin else mxw
(rmn, rmx) = if rmin <= rmax then (rmin, rmax) else (rmax, rmin)
rlen = min (max rmn len) rmx