diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 15:15:41 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 15:40:27 -0300 |
| commit | 2b9da7be7d9520701b24d46d8db2ec56517b45b8 (patch) | |
| tree | c434298ecf4b6d77c6bee55a6e485e6abca050ca /core/File.zig | |
| parent | a86e213e3e8053906df5ed4a37821c41a4afd932 (diff) | |
| download | pardes-2b9da7be7d9520701b24d46d8db2ec56517b45b8.tar.gz pardes-2b9da7be7d9520701b24d46d8db2ec56517b45b8.zip | |
layers: the lanes tell the truth about the text in the pane: jj annotates its last snapshot (`--ignore-working-copy`), not the keys typed since, so annotate's answer now carries each line's text (`id\tcontent`, the same one run) and `jj.provenance` lines the annotated text up with the pane's by what the two agree on at either end (`File.spanOf`, the editor's differ; the one line its two ends meet inside counts when its bytes agree: an inserted line shares its indent with the line after it), a line only the pane has nobody's (no lane, no ground); and an edit after `Changes` carries the per-line values with the lines (`jj.edited`: one call in `File.edit`, the one place a text changes, an undo's too, made only while the session has pinned changes): the lines a splice takes out take their values with them, a line it puts in is nobody's, and a splice that starts in a line's leading blanks (as `o` puts a line in) leaves that line's value after what it puts in; jj is never asked again on a key; tests: a line on disk jj has not snapshotted is nobody's and the lines after it keep their changes; a line typed in a nested block (`o`) is nobody's and the rows around keep their lanes, its undo puts the values back, a deleted line takes its value, a client replaying the keys ends equal; core-test 901/1061 (160 skipped), shell-test 1103/1106 (3 skipped)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/File.zig')
| -rw-r--r-- | core/File.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/File.zig b/core/File.zig index 6e44f85e..ae052344 100644 --- a/core/File.zig +++ b/core/File.zig @@ -756,6 +756,8 @@ fn edit(p: *Pardes, f: *State, off: usize, len: usize, bytes_in: []const u8, who }; }; reportEdit(p, f, off, len, bytes); + // A pinned change's per-line values ride with the lines (jj.zig). + if (p.changes.items.len > 0) @import("jj.zig").edited(p, f, off, len, bytes); if (f.mini) |*mini| mini.deinit(p.gpa); f.mini = null; if (f.line_starts.len > 0) shiftIndex(p.gpa, f, off, len, bytes); |
