@oh-my-pi/hashline 17.0.7 → 17.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/recovery.ts +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [17.0.8] - 2026-07-22
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Improved snapshot recovery line remapping by utilizing native line diffing.
|
|
10
|
+
- Switched line anchor recovery diffs to native `diffLineRuns`, processing UTF-16 code units directly and removing JS diff fallback.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- Removed npm `diff` dependency.
|
|
5
15
|
## [17.0.4] - 2026-07-18
|
|
6
16
|
|
|
7
17
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/hashline",
|
|
4
|
-
"version": "17.0.
|
|
4
|
+
"version": "17.0.8",
|
|
5
5
|
"description": "Hashline: a compact, line-anchored patch language and applier. Pluggable FS/IO so it works over disk, in-memory, or any custom backend.",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"fmt": "biome format --write ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
36
|
+
"@oh-my-pi/pi-natives": "17.0.8",
|
|
37
37
|
"lru-cache": "11.5.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
package/src/recovery.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Recovery fails closed when the target changed or became ambiguous. The
|
|
7
7
|
* patcher then returns a mismatch with fresh context instead of guessing.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { diffLineRuns } from "@oh-my-pi/pi-natives";
|
|
10
10
|
import { applyEdits } from "./apply";
|
|
11
11
|
import { RECOVERY_EXTERNAL_WARNING, RECOVERY_LINE_REMAP_WARNING, RECOVERY_SESSION_CHAIN_WARNING } from "./messages";
|
|
12
12
|
import type { SnapshotStore } from "./snapshots";
|
|
@@ -45,15 +45,13 @@ function getEditAnchors(edit: Edit): Anchor[] {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
function buildLineMap(previousText: string, currentText: string): Map<number, number> {
|
|
48
|
-
const
|
|
49
|
-
const currentLines = currentText.split("\n");
|
|
50
|
-
const changes = Diff.diffArrays(previousLines, currentLines);
|
|
48
|
+
const changes = diffLineRuns(previousText, currentText);
|
|
51
49
|
const map = new Map<number, number>();
|
|
52
50
|
let previousLine = 1;
|
|
53
51
|
let currentLine = 1;
|
|
54
52
|
|
|
55
53
|
for (const change of changes) {
|
|
56
|
-
const count = change.
|
|
54
|
+
const count = change.count;
|
|
57
55
|
if (change.added) {
|
|
58
56
|
currentLine += count;
|
|
59
57
|
continue;
|