copilot-statusline 0.1.5 → 0.1.7
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/dist/copilot-statusline.js +10 -4
- package/package.json +1 -1
|
@@ -52940,7 +52940,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
52940
52940
|
import * as fs5 from "fs";
|
|
52941
52941
|
import * as path4 from "path";
|
|
52942
52942
|
var __dirname = "/Users/ts/workspace/active/statusline/copilot_statusline/src/utils";
|
|
52943
|
-
var PACKAGE_VERSION = "0.1.
|
|
52943
|
+
var PACKAGE_VERSION = "0.1.7";
|
|
52944
52944
|
function getPackageVersion() {
|
|
52945
52945
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
52946
52946
|
return PACKAGE_VERSION;
|
|
@@ -54467,12 +54467,14 @@ class ContextPercentageUsableWidget {
|
|
|
54467
54467
|
}
|
|
54468
54468
|
}
|
|
54469
54469
|
// src/utils/progress-bar.ts
|
|
54470
|
+
var PROGRESS_BAR_FG_RESTORE = "\x1B[0;999;0q";
|
|
54470
54471
|
function makeUsageProgressBar(percent, width = 15, powerlineMode = false) {
|
|
54471
54472
|
const filled = Math.round(percent / 100 * width);
|
|
54472
54473
|
const empty = width - filled;
|
|
54473
54474
|
const bar = "█".repeat(filled) + "░".repeat(empty);
|
|
54474
54475
|
if (powerlineMode) {
|
|
54475
|
-
|
|
54476
|
+
const filledStr = filled > 0 ? `\x1B[38;5;231m${"█".repeat(filled)}${PROGRESS_BAR_FG_RESTORE}` : "";
|
|
54477
|
+
return `[${filledStr}${"░".repeat(empty)}]`;
|
|
54476
54478
|
}
|
|
54477
54479
|
return "[" + bar + "]";
|
|
54478
54480
|
}
|
|
@@ -54484,7 +54486,7 @@ function getDisplayMode(item) {
|
|
|
54484
54486
|
|
|
54485
54487
|
class ContextBarWidget {
|
|
54486
54488
|
getDefaultColor() {
|
|
54487
|
-
return "
|
|
54489
|
+
return "blue";
|
|
54488
54490
|
}
|
|
54489
54491
|
getDescription() {
|
|
54490
54492
|
return "Shows context usage as a progress bar";
|
|
@@ -62062,7 +62064,11 @@ function renderPowerlineStatusLine(widgets, settings, context, lineIndex = 0, gl
|
|
|
62062
62064
|
widgetContent += "\x1B[1m";
|
|
62063
62065
|
}
|
|
62064
62066
|
if (widget.fgColor && !isPreserveColors) {
|
|
62065
|
-
|
|
62067
|
+
const fgCode = getColorAnsiCode(widget.fgColor, colorLevel, false);
|
|
62068
|
+
widgetContent += fgCode;
|
|
62069
|
+
if (widget.content.includes(PROGRESS_BAR_FG_RESTORE)) {
|
|
62070
|
+
widget.content = widget.content.replace(PROGRESS_BAR_FG_RESTORE, fgCode);
|
|
62071
|
+
}
|
|
62066
62072
|
}
|
|
62067
62073
|
if (widget.bgColor) {
|
|
62068
62074
|
widgetContent += getColorAnsiCode(widget.bgColor, colorLevel, true);
|
package/package.json
CHANGED