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

Fix TextDocumentContentChangeEvents getting applied in the wrong order #603

Merged
merged 2 commits into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Haskell/Ide/Engine/Transport/LspStdio.hs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ updatePositionMap uri changes = pluginGetFile "updatePositionMap: " uri $ \file
ModuleCached cm _ -> do
let n2oOld = newPosToOld cm
o2nOld = oldPosToNew cm
(n2o,o2n) = foldr go (n2oOld, o2nOld) changes
go (J.TextDocumentContentChangeEvent (Just r) _ txt) (n2o', o2n') =
(n2o,o2n) = foldl' go (n2oOld, o2nOld) changes
go (n2o', o2n') (J.TextDocumentContentChangeEvent (Just r) _ txt) =
(n2o' <=< newToOld r txt, oldToNew r txt <=< o2n')
go _ _ = (const Nothing, const Nothing)
let cm' = cm {newPosToOld = n2o, oldPosToNew = o2n}
Expand Down
2 changes: 1 addition & 1 deletion submodules/haskell-lsp