summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar')
-rw-r--r--src/Xmobar/Plugins/Monitors/Common/Output.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Output.hs b/src/Xmobar/Plugins/Monitors/Common/Output.hs
index 4733a9f..3c18e87 100644
--- a/src/Xmobar/Plugins/Monitors/Common/Output.hs
+++ b/src/Xmobar/Plugins/Monitors/Common/Output.hs
@@ -3,7 +3,7 @@
------------------------------------------------------------------------------
-- |
-- Module: Xmobar.Plugins.Monitors.Strings
--- Copyright: (c) 2018, 2019 Jose Antonio Ortega Ruiz
+-- Copyright: (c) 2018, 2019, 2020 Jose Antonio Ortega Ruiz
-- License: BSD3-style (see LICENSE)
--
-- Maintainer: jao@gnu.org
@@ -224,7 +224,7 @@ showPercentBar v x = do
let c = bw < 1
w = if c then length bf else bw
len = min w $ round (fromIntegral w * x)
- bfs = if c then [bf !! (len - 1)] else take len $ cycle bf
+ bfs = if c then [bf !! max 0 (len - 1)] else take len $ cycle bf
s <- colorizeString v bfs
return $ s ++ if c then "" else take (bw - len) (cycle bb)