You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEV.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,10 @@ tools/build.sh release
45
45
cargo test&& pytest -q
46
46
```
47
47
48
+
## Hash verification timing
49
+
50
+
`edit_text` verifies lnhashes command-by-command against the current in-memory buffer, immediately before each command executes (not all upfront). If an earlier command shifts or rewrites a later target line, that later command will fail with a stale-hash error unless you recompute addresses.
51
+
48
52
## Release
49
53
50
54
Publishing is handled by GitHub Actions in `.github/workflows/ci.yml` and is triggered by pushing a tag matching `v*`.
`exhash(text, cmds)` takes the text and a required list of command strings (use `[]` for no-op). For `a`/`i`/`c` commands, lines after the command are the text block (no `.` terminator needed):
82
+
`exhash(text, cmds)` takes the text and a required iterable of command strings (use `[]` for no-op). For `a`/`i`/`c` commands, lines after the command are the text block (no `.` terminator needed):
81
83
82
84
```py
83
85
addr = lnhash(1, "foo") # "1|a1b2|"
@@ -89,6 +91,9 @@ print(res["modified"]) # [1]
89
91
a1, a2 = lnhash(1, "foo"), lnhash(2, "bar")
90
92
res = exhash(text, [f"{a1}s/foo/FOO/", f"{a2}s/bar/BAR/"])
91
93
94
+
# Hashes are checked just-in-time per command.
95
+
# If earlier commands change/shift a later target line, recompute lnhash first.
96
+
92
97
# Append multiline text (no dot terminator)
93
98
res = exhash(text, [f"{addr}a\nnew line 1\nnew line 2"])
0 commit comments