text-zipper 0.8.1 → 0.8.2
raw patch · 3 files changed
+11/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG +5/−0
- src/Data/Text/Zipper.hs +5/−4
- text-zipper.cabal +1/−1
CHANGELOG view
@@ -1,3 +1,8 @@+0.8.2+-----++- Fixed insertMany for zippers with no line limit+ 0.8.1 -----
src/Data/Text/Zipper.hs view
@@ -195,8 +195,12 @@ insertMany :: (Monoid a) => a -> TextZipper a -> TextZipper a insertMany cs tz = let ls = lines_ tz cs+ go [] z = z+ go (a:as) z = go as $ breakLine $ z { toLeft = toLeft z `mappend` a } in case lineLimit tz of- Nothing -> tz { toLeft = toLeft tz `mappend` cs }+ Nothing ->+ let toInsert = ls+ in go toInsert tz Just limit -> -- How many more lines can we add without violating the -- limit?@@ -204,9 +208,6 @@ remainingLines = max 0 (limit - totalLines) totalLines = length (above tz) + length (below tz)-- go [] z = z- go (a:as) z = go as $ breakLine $ z { toLeft = toLeft z `mappend` a } in go toInsert tz -- |Insert a line break at the current cursor position.
text-zipper.cabal view
@@ -1,5 +1,5 @@ name: text-zipper-version: 0.8.1+version: 0.8.2 synopsis: A text editor zipper library description: This library provides a zipper and API for editing text. license: BSD3