on develop help sign in
Clarify goToDisplayLinePosition docs
d589d9eAli Abrar
src/Data/Text/Zipper.hs+4−2
@@ -280,8 +280,10 @@ offsetMap ts = evalState (offsetMap' ts) (0, 0)
280 put (dl, o + 1)
280 put (dl, o + 1)
281 return $ Map.insert dl (o + 1) $ Map.unions maps
281 return $ Map.insert dl (o + 1) $ Map.unions maps
282
282
283−-- | Move the cursor of the given 'TextZipper' to the logical position indicated by
283+-- | Move the cursor of the given 'TextZipper' to the logical position indicated
284−-- the given display line coordinates, using the provided 'DisplayLines' information.
284+-- by the given display line coordinates, using the provided 'DisplayLines'
285+-- information. If the x coordinate is beyond the end of a line, the cursor is
286+-- moved to the end of the line.
285goToDisplayLinePosition :: Int -> Int -> DisplayLines tag -> TextZipper -> TextZipper
287goToDisplayLinePosition :: Int -> Int -> DisplayLines tag -> TextZipper -> TextZipper
286goToDisplayLinePosition x y dl tz =
288goToDisplayLinePosition x y dl tz =
287 let offset = Map.lookup y $ _displayLines_offsetMap dl
289 let offset = Map.lookup y $ _displayLines_offsetMap dl