{"draft":null,"from":165,"to":166,"files":[{"path":"src/engine/experimental/projection-reader.ts","added":18,"removed":3,"diff":"--- a/src/engine/experimental/projection-reader.ts\n+++ b/src/engine/experimental/projection-reader.ts\n@@ -1,6 +1,5 @@\n import { startNode } from \"../keys.ts\";\n import { StableSet } from \"../state-source.ts\";\n-import { joinLines } from \"../text.ts\";\n import type { FileAttrs, ReadView, SeqLine, VisibleLine } from \"../view.ts\";\n import type { ExperimentalMarkerProjection, MarkerState } from \"./projection-marker.ts\";\n \n@@ -74,7 +73,14 @@\n \t}\n \tlineNumber(path: string, line: string): number {\n \t\tthis.#assertLive();\n-\t\treturn this.lines(path).findIndex((item) => item.id === line);\n+\t\tlet index = 0;\n+\t\tfor (const id of this.#adapter.lineIds(this.#state, path)) {\n+\t\t\tthis.#assertLive();\n+\t\t\tif (id === line) return index;\n+\t\t\tindex++;\n+\t\t}\n+\t\tthis.#assertLive();\n+\t\treturn -1;\n \t}\n \tsameText(path: string, other: ReadView): boolean {\n \t\tthis.#assertLive();\n@@ -193,7 +199,16 @@\n \t}\n \ttext(path: string): string {\n \t\tthis.#assertLive();\n-\t\treturn joinLines([...this.visibleLines(path)].map((line) => line.text));\n+\t\tlet text = \"\",\n+\t\t\tpart = \"\";\n+\t\tfor (const line of this.visibleLines(path)) {\n+\t\t\tpart += `${line.text}\\n`;\n+\t\t\tif (part.length >= 16384) {\n+\t\t\t\ttext += part;\n+\t\t\t\tpart = \"\";\n+\t\t\t}\n+\t\t}\n+\t\treturn text + part;\n \t}\n \thasFile(path: string): boolean {\n \t\tthis.#assertLive();"}],"unmatched":[]}