Skip to content

Commit 99ba3d3

Browse files
committed
Fix another bug in diffOperationToTextEdit
We were taking max of l and sl but the position of an insertion in the newer document is irrelevant since the edits will be applied from bottom to top.
1 parent 4748baf commit 99ba3d3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Ide/PluginUtils.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ diffTextEdit fText f2Text withDeletions = J.List r
7070
-- fm has a range wrt to the changed file, which starts in the current file at l + 1
7171
-- So the range has to be shifted to start at l + 1
7272
where
73-
range = J.Range (J.Position (l' - 1) 0)
74-
(J.Position (l' - 1) 0)
75-
l' = max (l + 1) sl -- Needed to add at the end of the file
76-
sl = fst $ lrNumbers fm
73+
range = J.Range (J.Position l 0)
74+
(J.Position l 0)
7775
nt = T.pack $ unlines $ lrContents fm
7876

7977

0 commit comments

Comments
 (0)