@narumitw/pi-statusline 0.28.0 → 0.34.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-statusline",
3
- "version": "0.28.0",
3
+ "version": "0.34.0",
4
4
  "description": "Pi extension that replaces the footer with an information-rich statusline.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,9 +28,9 @@
28
28
  "typecheck": "tsc --noEmit"
29
29
  },
30
30
  "devDependencies": {
31
- "@biomejs/biome": "2.5.3",
32
- "@earendil-works/pi-coding-agent": "0.80.10",
33
- "@earendil-works/pi-tui": "0.80.10",
31
+ "@biomejs/biome": "2.5.5",
32
+ "@earendil-works/pi-coding-agent": "0.82.1",
33
+ "@earendil-works/pi-tui": "0.82.1",
34
34
  "@types/node": "26.1.1",
35
35
  "typescript": "7.0.2"
36
36
  },
@@ -309,7 +309,7 @@ function packageNameForSource(source: string, baseDirectory: string): string | u
309
309
 
310
310
  export function npmPackageName(source: string): string {
311
311
  const spec = source.slice("npm:".length);
312
- if (spec.startsWith("@")) return spec.split("@").slice(0, 2).join("@").replace(/^@/, "@");
312
+ if (spec.startsWith("@")) return spec.split("@").slice(0, 2).join("@");
313
313
  return spec.split("@")[0] ?? spec;
314
314
  }
315
315
 
package/src/powerline.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Theme } from "@earendil-works/pi-coding-agent";
2
- import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
+ import { visibleWidth } from "@earendil-works/pi-tui";
3
3
  import { ansiStyle } from "./ansi.js";
4
4
  import { resolvePreset } from "./presets/index.js";
5
5
  import type { BlockColors, PowerlinePreset } from "./presets/types.js";
@@ -79,7 +79,8 @@ function fitPowerlineSegments(
79
79
  }
80
80
  fitted.splice(removalIndex, 1);
81
81
  }
82
- return truncateToWidth(joinPowerlineSegments(fitted, config), width, "");
82
+ const rendered = joinPowerlineSegments(fitted, config);
83
+ return visibleWidth(rendered) <= width ? rendered : "";
83
84
  }
84
85
 
85
86
  export function powerlineExtensionSeparator(