pi-diet 0.1.2 → 0.1.3
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/README.md +3 -3
- package/index.ts +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/index.ts
CHANGED
|
@@ -10,12 +10,16 @@ export default function dietPi(pi: ExtensionAPI) {
|
|
|
10
10
|
return `pi-diet ${settings.enabled ? "on" : "off"} · threshold=${settings.thresholdChars} · head=${settings.headChars} · tail=${settings.tailChars}`;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
function footerStatusText(): string {
|
|
14
|
+
return `diet:${settings.enabled ? "on" : "off"}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
function refreshStatus(ctx: { hasUI: boolean; ui: { setStatus: (key: string, text: string | undefined) => void } }) {
|
|
14
18
|
if (!ctx.hasUI) return;
|
|
15
|
-
ctx.ui.setStatus(STATUS_KEY,
|
|
19
|
+
ctx.ui.setStatus(STATUS_KEY, footerStatusText());
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
pi.registerCommand("diet
|
|
22
|
+
pi.registerCommand("diet", {
|
|
19
23
|
description: "Control pi-diet result compaction: status | on | off",
|
|
20
24
|
handler: async (args, ctx) => {
|
|
21
25
|
const action = args.trim().toLowerCase();
|
|
@@ -36,7 +40,7 @@ export default function dietPi(pi: ExtensionAPI) {
|
|
|
36
40
|
refreshStatus(ctx);
|
|
37
41
|
return;
|
|
38
42
|
}
|
|
39
|
-
ctx.ui.notify("Usage: /diet
|
|
43
|
+
ctx.ui.notify("Usage: /diet status|on|off", "warning");
|
|
40
44
|
},
|
|
41
45
|
});
|
|
42
46
|
|