santree 0.2.7 → 0.2.8
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.
|
@@ -175,11 +175,11 @@ function buildSantreeStatusline(cwd, model, usedPercentage) {
|
|
|
175
175
|
if (model) {
|
|
176
176
|
parts.push(`${c.blue}${model}${c.reset}`);
|
|
177
177
|
}
|
|
178
|
-
//
|
|
178
|
+
// Context usage %
|
|
179
179
|
if (usedPercentage !== null) {
|
|
180
|
-
const
|
|
181
|
-
const color =
|
|
182
|
-
parts.push(`${color}${
|
|
180
|
+
const used = Math.round(usedPercentage);
|
|
181
|
+
const color = used >= 80 ? c.red : used >= 60 ? c.yellow : c.green;
|
|
182
|
+
parts.push(`${color}${used}%${c.reset}`);
|
|
183
183
|
}
|
|
184
184
|
return parts.join(" | ");
|
|
185
185
|
}
|
|
@@ -200,11 +200,11 @@ function buildGitStatusline(cwd, model, usedPercentage) {
|
|
|
200
200
|
if (model) {
|
|
201
201
|
parts.push(`${c.blue}${model}${c.reset}`);
|
|
202
202
|
}
|
|
203
|
-
//
|
|
203
|
+
// Context usage %
|
|
204
204
|
if (usedPercentage !== null) {
|
|
205
|
-
const
|
|
206
|
-
const color =
|
|
207
|
-
parts.push(`${color}${
|
|
205
|
+
const used = Math.round(usedPercentage);
|
|
206
|
+
const color = used >= 80 ? c.red : used >= 60 ? c.yellow : c.green;
|
|
207
|
+
parts.push(`${color}${used}%${c.reset}`);
|
|
208
208
|
}
|
|
209
209
|
return parts.join(" | ");
|
|
210
210
|
}
|
|
@@ -218,11 +218,11 @@ function buildPlainStatusline(cwd, model, usedPercentage) {
|
|
|
218
218
|
if (model) {
|
|
219
219
|
parts.push(`${c.blue}${model}${c.reset}`);
|
|
220
220
|
}
|
|
221
|
-
//
|
|
221
|
+
// Context usage %
|
|
222
222
|
if (usedPercentage !== null) {
|
|
223
|
-
const
|
|
224
|
-
const color =
|
|
225
|
-
parts.push(`${color}${
|
|
223
|
+
const used = Math.round(usedPercentage);
|
|
224
|
+
const color = used >= 80 ? c.red : used >= 60 ? c.yellow : c.green;
|
|
225
|
+
parts.push(`${color}${used}%${c.reset}`);
|
|
226
226
|
}
|
|
227
227
|
return parts.join(" | ");
|
|
228
228
|
}
|