@kaynooo/cli-git 0.15.1 → 0.15.2

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.
Files changed (2) hide show
  1. package/dist/gb.js +10 -3
  2. package/package.json +2 -2
package/dist/gb.js CHANGED
@@ -1671,6 +1671,14 @@ import { openSync } from "fs";
1671
1671
  import process19 from "process";
1672
1672
  import tty from "tty";
1673
1673
 
1674
+ // ../kit/src/redraw.ts
1675
+ var SYNC_START = "\x1B[?2026h";
1676
+ var SYNC_END = "\x1B[?2026l";
1677
+ function overwrite(lines, columns) {
1678
+ return lines.map((line) => textWidth(line) < columns ? `${line}\x1B[K` : `\x1B[2K${line}`).join(`
1679
+ `);
1680
+ }
1681
+
1674
1682
  // ../kit/src/picker/preview.ts
1675
1683
  import process18 from "process";
1676
1684
 
@@ -1942,14 +1950,13 @@ async function select(rows, settings, terminal = openTerminal()) {
1942
1950
  if (restored)
1943
1951
  return;
1944
1952
  const layout = layoutFor({ columns: terminal.columns, rows: terminal.rows }, settings.height, settings.preview !== undefined, settings.previewPosition);
1945
- let frame = HIDE_CURSOR;
1953
+ let frame = SYNC_START + HIDE_CURSOR;
1946
1954
  if (reserved !== layout.height || clear) {
1947
1955
  frame += CLEAR_BELOW2 + `
1948
1956
  `.repeat(layout.height - 1) + up(layout.height - 1);
1949
1957
  reserved = layout.height;
1950
1958
  }
1951
- frame += `\r${render(state, layout, theme, preview).map((line) => `\x1B[2K${line}`).join(`
1952
- `)}${up(layout.height - 1)}\r\x1B[${caretColumn(state, layout)}G${CARET}\r`;
1959
+ frame += `\r${overwrite(render(state, layout, theme, preview), terminal.columns)}${up(layout.height - 1)}\r\x1B[${caretColumn(state, layout)}G${CARET}\r${SYNC_END}`;
1953
1960
  terminal.write(frame);
1954
1961
  }
1955
1962
  function pageSize() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kaynooo/cli-git",
3
3
  "type": "module",
4
- "version": "0.15.1",
4
+ "version": "0.15.2",
5
5
  "description": "gst, gc, gb, gp, gf, gcl, gd and gu: a repository's state in one call, a commit of exactly the paths given, its message checked before anything is staged, a branch picked, nested repositories pushed or fetched, a clone into the workspace, the changes per file and an undo that keeps what it takes away.",
6
6
  "author": "Kaynooo <contact@kaynooo.fr>",
7
7
  "license": "MIT",
@@ -54,6 +54,6 @@
54
54
  "gu": "$npm_execpath src/gu.ts"
55
55
  },
56
56
  "devDependencies": {
57
- "@kaynooo/cli-kit": "0.38.2"
57
+ "@kaynooo/cli-kit": "0.38.4"
58
58
  }
59
59
  }