@@ -280,8 +280,10 @@ offsetMap ts = evalState (offsetMap' ts) (0, 0)
280280 put (dl, o + 1)
281281 return $ Map.insert dl (o + 1) $ Map.unions maps
282282
283−-- | Move the cursor of the given 'TextZipper' to the logical position indicated by
284−-- the given display line coordinates, using the provided 'DisplayLines' information.
283+-- | Move the cursor of the given 'TextZipper' to the logical position indicated
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.
285287goToDisplayLinePosition :: Int -> Int -> DisplayLines tag -> TextZipper -> TextZipper
286288goToDisplayLinePosition x y dl tz =
287289 let offset = Map.lookup y $ _displayLines_offsetMap dl