@xynogen/pix-pretty 1.7.0 → 1.7.1
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 +1 -1
- package/src/diff-render.ts +4 -13
package/package.json
CHANGED
package/src/diff-render.ts
CHANGED
|
@@ -56,7 +56,6 @@ const BG_ADD_W = envBg("DIFF_BG_ADD_HL", "\x1b[48;2;35;75;50m"); // word emphasi
|
|
|
56
56
|
const BG_DEL_W = envBg("DIFF_BG_DEL_HL", "\x1b[48;2;80;35;35m");
|
|
57
57
|
const BG_GUTTER_ADD = envBg("DIFF_BG_GUTTER_ADD", "\x1b[48;2;18;32;26m");
|
|
58
58
|
const BG_GUTTER_DEL = envBg("DIFF_BG_GUTTER_DEL", "\x1b[48;2;38;22;22m");
|
|
59
|
-
const BG_EMPTY = "\x1b[48;2;18;18;18m"; // filler rows when one side is shorter
|
|
60
59
|
|
|
61
60
|
const FG_ADD = envFg("DIFF_FG_ADD", "\x1b[38;2;100;180;120m"); // desaturated green
|
|
62
61
|
const FG_DEL = envFg("DIFF_FG_DEL", "\x1b[38;2;200;100;100m"); // desaturated red
|
|
@@ -912,21 +911,13 @@ export async function renderSplit(
|
|
|
912
911
|
}
|
|
913
912
|
|
|
914
913
|
const maxRowsN = Math.max(lResult.bodyRows.length, rResult.bodyRows.length);
|
|
915
|
-
const leftIsEmpty = !r.left;
|
|
916
|
-
const rightIsEmpty = !r.right;
|
|
917
914
|
for (let row = 0; row < maxRowsN; row++) {
|
|
918
915
|
const lg = row === 0 ? lResult.gutter : lResult.contGutter;
|
|
919
916
|
const rg = row === 0 ? rResult.gutter : rResult.contGutter;
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
: `${BG_EMPTY}${" ".repeat(cw)}${RST}`);
|
|
925
|
-
const rb =
|
|
926
|
-
rResult.bodyRows[row] ??
|
|
927
|
-
(rightIsEmpty
|
|
928
|
-
? stripes(cw, stripeRow)
|
|
929
|
-
: `${BG_EMPTY}${" ".repeat(cw)}${RST}`);
|
|
917
|
+
// A missing body row means this side has no content at this visual row
|
|
918
|
+
// (other side wrapped longer, or the side is empty) — always hatch it.
|
|
919
|
+
const lb = lResult.bodyRows[row] ?? stripes(cw, stripeRow);
|
|
920
|
+
const rb = rResult.bodyRows[row] ?? stripes(cw, stripeRow);
|
|
930
921
|
out.push(`${lg}${lb}${DIVIDER}${rg}${rb}${RST}`);
|
|
931
922
|
stripeRow++;
|
|
932
923
|
}
|