Fix eclipse behaviour when printing times

master
Lennart Spitzner 2023-02-21 20:21:33 +01:00
parent 49ffea3f2e
commit fb24ad389c
1 changed files with 7 additions and 4 deletions

View File

@ -449,10 +449,13 @@ ellipseFloat conf start floatright =
in case c_termSize conf of in case c_termSize conf of
Nothing -> start <> floatright Nothing -> start <> floatright
Just (_, w) -> Just (_, w) ->
let remaining = w - 2 - startLength - floatLength let space = w - floatLength - 2
in if remaining >= 0 in if space >= startLength
then start <> Text.replicate remaining (t " ") <> floatright then
else Text.take (remaining - 1) start <> t "" <> floatright start
<> Text.replicate (space - startLength) (t " ")
<> floatright
else Text.take (space - 1) start <> t "" <> floatright
ellipse :: Config -> Text -> Text ellipse :: Config -> Text -> Text
ellipse conf x = ellipseFloat conf x (Text.empty) ellipse conf x = ellipseFloat conf x (Text.empty)