Skip to content

Commit

Permalink
Don't jump out of text bounds with moveTo
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuuzetsu committed Oct 24, 2014
1 parent 2c6f1f0 commit 00deca4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yi/src/library/Yi/Buffer/Misc.hs
Expand Up @@ -601,7 +601,12 @@ strokesRangesB regex r = do
moveTo :: Point -> BufferM ()
moveTo x = do
forgetPreferCol
(.= x) . markPointA =<< getInsMark
maxP <- sizeB
let p = case () of
_ | x < 0 -> Point 0
| x > maxP -> maxP
| otherwise -> x
(.= p) . markPointA =<< getInsMark

------------------------------------------------------------------------

Expand Down

0 comments on commit 00deca4

Please sign in to comment.