Fix ColumnAlign problem for multibyte strings #122
parent
1e8d62232c
commit
62f2f4977d
|
@ -264,7 +264,7 @@ briDocLineLength briDoc = flip StateS.evalState False $ rec briDoc
|
|||
where
|
||||
rec = \case
|
||||
BDEmpty -> return $ 0
|
||||
BDLit t -> StateS.put False $> Text.length t
|
||||
BDLit t -> StateS.put False $> elasticLength t
|
||||
BDSeq bds -> sum <$> rec `mapM` bds
|
||||
BDCols _ bds -> sum <$> rec `mapM` bds
|
||||
BDSeparator -> StateS.get >>= \b -> StateS.put True $> if b then 0 else 1
|
||||
|
|
|
@ -99,7 +99,7 @@ layoutWriteAppend t = do
|
|||
mTell $ Text.Builder.fromText $ t
|
||||
mModify $ \s -> s
|
||||
{ _lstate_curYOrAddNewline = Left $ case _lstate_curYOrAddNewline s of
|
||||
Left c -> c + Text.length t + spaces
|
||||
Left c -> c + elasticLength t + spaces
|
||||
Right{} -> Text.length t + spaces
|
||||
, _lstate_addSepSpace = Nothing
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue