copilot-statusline 0.1.4 → 0.1.6
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.
|
@@ -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.6";
|
|
52944
52944
|
function getPackageVersion() {
|
|
52945
52945
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
52946
52946
|
return PACKAGE_VERSION;
|
|
@@ -54467,12 +54467,13 @@ 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
|
-
return `\x1B[
|
|
54476
|
+
return `\x1B[38;5;231m[${bar}]${PROGRESS_BAR_FG_RESTORE}`;
|
|
54476
54477
|
}
|
|
54477
54478
|
return "[" + bar + "]";
|
|
54478
54479
|
}
|
|
@@ -54484,7 +54485,7 @@ function getDisplayMode(item) {
|
|
|
54484
54485
|
|
|
54485
54486
|
class ContextBarWidget {
|
|
54486
54487
|
getDefaultColor() {
|
|
54487
|
-
return "
|
|
54488
|
+
return "blue";
|
|
54488
54489
|
}
|
|
54489
54490
|
getDescription() {
|
|
54490
54491
|
return "Shows context usage as a progress bar";
|
|
@@ -62062,7 +62063,11 @@ function renderPowerlineStatusLine(widgets, settings, context, lineIndex = 0, gl
|
|
|
62062
62063
|
widgetContent += "\x1B[1m";
|
|
62063
62064
|
}
|
|
62064
62065
|
if (widget.fgColor && !isPreserveColors) {
|
|
62065
|
-
|
|
62066
|
+
const fgCode = getColorAnsiCode(widget.fgColor, colorLevel, false);
|
|
62067
|
+
widgetContent += fgCode;
|
|
62068
|
+
if (widget.content.includes(PROGRESS_BAR_FG_RESTORE)) {
|
|
62069
|
+
widget.content = widget.content.replace(PROGRESS_BAR_FG_RESTORE, fgCode);
|
|
62070
|
+
}
|
|
62066
62071
|
}
|
|
62067
62072
|
if (widget.bgColor) {
|
|
62068
62073
|
widgetContent += getColorAnsiCode(widget.bgColor, colorLevel, true);
|
package/package.json
CHANGED