diff --git a/src/text/text_document.nim b/src/text/text_document.nim index 43b4fd4a..197853b7 100644 --- a/src/text/text_document.nim +++ b/src/text/text_document.nim @@ -260,10 +260,15 @@ proc `content=`*(self: TextDocument, value: string) = var newLine = value.find('\n', start=index) self.lines = @[""] while newLine != -1: + let newLineStart = if newLine > 0 and value[newLine - 1] == '\r': + newLine - 1 + else: + newLine + if self.singleLine: - self.lines[0].add value[index..