Skip to content

Commit 7938ac0

Browse files
Fix index access panic (#74)
* Fix index access panic Oops, the second "if" crashes * Remove empty line
1 parent b2f7418 commit 7938ac0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/server/server.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDo
9393
splitOldText := strings.Split(oldText, "\n")
9494
splitNewText := strings.Split(doc.item.Text, "\n")
9595
for index, oldLine := range splitOldText {
96-
if index >= len(splitNewText) {
97-
doc.linesChangedSinceAST[index] = true
98-
}
99-
if oldLine != splitNewText[index] {
96+
if index >= len(splitNewText) || oldLine != splitNewText[index] {
10097
doc.linesChangedSinceAST[index] = true
10198
}
10299
}

0 commit comments

Comments
 (0)