{"draft":null,"from":162,"to":163,"files":[{"path":"src/engine/experimental/projection-reader.ts","added":15,"removed":3,"diff":"--- a/src/engine/experimental/projection-reader.ts\n+++ b/src/engine/experimental/projection-reader.ts\n@@ -175,9 +175,21 @@\n \tfileOf(line: string): string {\n \t\tthis.#assertLive();\n \t\tif (line.startsWith(\"^\")) return line.slice(1);\n-\t\tconst marker = this.#adapter.markers.get(this.#state.locator, this.graph.lineN(line) + 1);\n-\t\tif (marker?.kind !== \"line\") throw Error(\"missing projected line\");\n-\t\treturn this.#adapter.sequence.fileAt(this.#state.sequence, marker.enter);\n+\t\tlet current = line;\n+\t\twhile (!current.startsWith(\"^\")) {\n+\t\t\tconst n = this.graph.lineN(current);\n+\t\t\tif (n < 0) throw Error(\"unknown projected line\");\n+\t\t\tconst marker = this.#adapter.markers.get(this.#state.locator, n + 1);\n+\t\t\tif (marker?.kind === \"line\") return this.#adapter.sequence.fileAt(this.#state.sequence, marker.enter);\n+\t\t\t// A line written outside this view has no marker. Follow canonical ancestry\n+\t\t\t// until it reaches a line whose placement this view actually contains.\n+\t\t\tif (marker || this.#adapter.members.get(this.#state.membership, this.graph.writerSeqOf(n))?.present)\n+\t\t\t\tthrow Error(\"missing projected line\");\n+\t\t\tconst parent = this.graph.lineParent(current);\n+\t\t\tif (parent === undefined) throw Error(\"missing projected line parent\");\n+\t\t\tcurrent = parent;\n+\t\t}\n+\t\treturn current.slice(1);\n \t}\n \ttext(path: string): string {\n \t\tthis.#assertLive();"}],"unmatched":[]}