1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Allow the reverse path to add edits.

This commit is contained in:
Rob Rix 2017-03-16 13:34:56 -04:00
parent cb5e501027
commit f10a2cd32f

View File

@ -141,7 +141,7 @@ decompose myers = let ?callStack = popCallStack callStack in case myers of
where at :: Vector.Vector a -> Int -> a
v `at` i = v Vector.! case direction of { Forward -> i ; Reverse -> length v - succ i }
addInBounds :: Vector.Vector a -> Int -> (a -> b) -> [b] -> [b]
addInBounds v i with to = if d /= 0 && i >= 0 && i < length v then addFor direction (with (v `at` i)) to else to
addInBounds v i with to = if (d /= 0 || direction == Reverse) && i >= 0 && i < length v then addFor direction (with (v `at` i)) to else to
GetK _ direction (Diagonal k) -> do
v <- gets (stateFor direction)