pi-readseek 0.4.18 → 0.4.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/hashline.ts +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-readseek",
3
- "version": "0.4.18",
3
+ "version": "0.4.19",
4
4
  "description": "Pi extension for readseek-backed hash-anchored read/edit/grep, structural code maps, structural search, and file exploration",
5
5
  "type": "module",
6
6
  "exports": {
package/src/hashline.ts CHANGED
@@ -121,7 +121,11 @@ export function formatHashlineDisplay(lineNumber: number, content: string): stri
121
121
  export function parseLineRef(ref: string): { line: number; hash: string; content?: string } {
122
122
  const contentMatch = ref.match(/^[^|]*\|(.*)$/);
123
123
  const contentAfterPipe = contentMatch ? contentMatch[1] : undefined;
124
- const cleaned = ref.replace(/\|.*$/, "").replace(/ {2}.*$/, "").trim();
124
+ const cleaned = ref
125
+ .replace(/\|.*$/, "") // drop |content suffix
126
+ .replace(/^[\s>]+/, "") // drop leading gutter: >> / >>> / indentation
127
+ .replace(/ {2}.*$/, "") // drop trailing " comment"
128
+ .trim();
125
129
  const normalized = cleaned.replace(/\s*:\s*/, ":");
126
130
  const match = normalized.match(new RegExp(`^(\\d+):([0-9a-fA-F]{${HASH_LEN}})$`));
127
131
  if (!match) throw new Error(`Invalid line reference "${ref}". Expected "LINE:HASH" (e.g. "5:abc").`);