From fb24ad389c2019b4c8539d1c6d0d9f6d5c1d2777 Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Tue, 21 Feb 2023 20:21:33 +0100 Subject: [PATCH] Fix eclipse behaviour when printing times --- src-hxbrief/Main.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src-hxbrief/Main.hs b/src-hxbrief/Main.hs index 4117a4e..d6543c7 100644 --- a/src-hxbrief/Main.hs +++ b/src-hxbrief/Main.hs @@ -449,10 +449,13 @@ ellipseFloat conf start floatright = in case c_termSize conf of Nothing -> start <> floatright Just (_, w) -> - let remaining = w - 2 - startLength - floatLength - in if remaining >= 0 - then start <> Text.replicate remaining (t " ") <> floatright - else Text.take (remaining - 1) start <> t "…" <> floatright + let space = w - floatLength - 2 + in if space >= startLength + then + start + <> Text.replicate (space - startLength) (t " ") + <> floatright + else Text.take (space - 1) start <> t "…" <> floatright ellipse :: Config -> Text -> Text ellipse conf x = ellipseFloat conf x (Text.empty)