Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 2aa2cf3

Browse files
authored
Merge pull request #603 from Bubba/textedit-fix
Fix TextDocumentContentChangeEvents getting applied in the wrong order
2 parents c61d2df + 34ead13 commit 2aa2cf3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Haskell/Ide/Engine/Transport/LspStdio.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ updatePositionMap uri changes = pluginGetFile "updatePositionMap: " uri $ \file
265265
ModuleCached cm _ -> do
266266
let n2oOld = newPosToOld cm
267267
o2nOld = oldPosToNew cm
268-
(n2o,o2n) = foldr go (n2oOld, o2nOld) changes
269-
go (J.TextDocumentContentChangeEvent (Just r) _ txt) (n2o', o2n') =
268+
(n2o,o2n) = foldl' go (n2oOld, o2nOld) changes
269+
go (n2o', o2n') (J.TextDocumentContentChangeEvent (Just r) _ txt) =
270270
(n2o' <=< newToOld r txt, oldToNew r txt <=< o2n')
271271
go _ _ = (const Nothing, const Nothing)
272272
let cm' = cm {newPosToOld = n2o, oldPosToNew = o2n}

submodules/haskell-lsp

0 commit comments

Comments
 (0)