coc-git 2.7.4 → 2.7.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.
- package/lib/index.js +13 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -6443,7 +6443,9 @@ var Git = class {
|
|
|
6443
6443
|
LC_ALL: "en_US.UTF-8",
|
|
6444
6444
|
LANG: "en_US.UTF-8"
|
|
6445
6445
|
});
|
|
6446
|
-
|
|
6446
|
+
if (process.platform === "win32") {
|
|
6447
|
+
options.shell = true;
|
|
6448
|
+
}
|
|
6447
6449
|
if (options.log !== false) {
|
|
6448
6450
|
this.log(`> git ${args.join(" ")}
|
|
6449
6451
|
`);
|
|
@@ -6879,15 +6881,11 @@ var GitBuffer = class {
|
|
|
6879
6881
|
let content = diff.head + "\n" + diff.lines.join("\n");
|
|
6880
6882
|
await this.showDoc(content, "diff");
|
|
6881
6883
|
} else {
|
|
6882
|
-
let chunks;
|
|
6884
|
+
let chunks = [];
|
|
6883
6885
|
try {
|
|
6884
6886
|
let stagedDiff = await this.repo.getStagedChunks(this.relpath);
|
|
6885
6887
|
chunks = Object.values(stagedDiff)[0];
|
|
6886
6888
|
} catch (e) {
|
|
6887
|
-
return;
|
|
6888
|
-
}
|
|
6889
|
-
if (!chunks.length) {
|
|
6890
|
-
return;
|
|
6891
6889
|
}
|
|
6892
6890
|
let adjust = 0;
|
|
6893
6891
|
for (let diff2 of this.diffs) {
|
|
@@ -6902,6 +6900,8 @@ var GitBuffer = class {
|
|
|
6902
6900
|
if (chunk) {
|
|
6903
6901
|
let content = "Staged changes\n" + chunk.lines.join("\n");
|
|
6904
6902
|
await this.showDoc(content, "diff");
|
|
6903
|
+
} else {
|
|
6904
|
+
await this.showCommit(true);
|
|
6905
6905
|
}
|
|
6906
6906
|
}
|
|
6907
6907
|
}
|
|
@@ -6974,6 +6974,7 @@ var GitBuffer = class {
|
|
|
6974
6974
|
if (((_a = this.currentSigns) == null ? void 0 : _a.length) > 0) {
|
|
6975
6975
|
this.currentSigns = [];
|
|
6976
6976
|
nvim.call("sign_unplace", [signGroup, { buffer: bufnr }], true);
|
|
6977
|
+
nvim.redrawVim();
|
|
6977
6978
|
}
|
|
6978
6979
|
return;
|
|
6979
6980
|
}
|
|
@@ -6985,6 +6986,7 @@ var GitBuffer = class {
|
|
|
6985
6986
|
this.setBufferStatus("");
|
|
6986
6987
|
if (this.config.enableGutters) {
|
|
6987
6988
|
nvim.call("sign_unplace", [signGroup, { buffer: bufnr }], true);
|
|
6989
|
+
nvim.redrawVim();
|
|
6988
6990
|
}
|
|
6989
6991
|
this.currentSigns = [];
|
|
6990
6992
|
} else {
|
|
@@ -7049,7 +7051,7 @@ var GitBuffer = class {
|
|
|
7049
7051
|
let name = this.getSignName(sign.changeType);
|
|
7050
7052
|
nvim.call("sign_place", [0, signGroup, name, bufnr, { lnum: sign.lnum, priority: signPriority }], true);
|
|
7051
7053
|
}
|
|
7052
|
-
nvim.resumeNotification(
|
|
7054
|
+
nvim.resumeNotification(true, true);
|
|
7053
7055
|
}
|
|
7054
7056
|
async loadBlames() {
|
|
7055
7057
|
if (!this.showBlame) return;
|
|
@@ -7262,7 +7264,7 @@ var GitBuffer = class {
|
|
|
7262
7264
|
}
|
|
7263
7265
|
}
|
|
7264
7266
|
// show commit of current line in split window
|
|
7265
|
-
async showCommit() {
|
|
7267
|
+
async showCommit(useFloating = false) {
|
|
7266
7268
|
let indexed = await this.repo.isIndexed(this.relpath);
|
|
7267
7269
|
if (!indexed) {
|
|
7268
7270
|
import_coc13.window.showWarningMessage(`"${this.relpath}" not indexed.`);
|
|
@@ -7279,7 +7281,7 @@ var GitBuffer = class {
|
|
|
7279
7281
|
import_coc13.window.showWarningMessage("not committed yet!");
|
|
7280
7282
|
return;
|
|
7281
7283
|
}
|
|
7282
|
-
|
|
7284
|
+
if (!useFloating) useFloating = this.config.showCommitInFloating;
|
|
7283
7285
|
if (useFloating) {
|
|
7284
7286
|
let content = await this.repo.safeRun(["--no-pager", "show", commit]);
|
|
7285
7287
|
if (content == null) return;
|
|
@@ -7382,6 +7384,7 @@ var GitBuffer = class {
|
|
|
7382
7384
|
let { nvim } = import_coc13.workspace;
|
|
7383
7385
|
if (!enabled) {
|
|
7384
7386
|
nvim.call("sign_unplace", [signGroup, { buffer: this.doc.bufnr }], true);
|
|
7387
|
+
nvim.redrawVim();
|
|
7385
7388
|
} else {
|
|
7386
7389
|
this.diffs = [];
|
|
7387
7390
|
await this.diffDocument(true);
|
|
@@ -7498,7 +7501,7 @@ var GitBuffer = class {
|
|
|
7498
7501
|
let buffer = nvim.createBuffer(this.doc.bufnr);
|
|
7499
7502
|
nvim.pauseNotification();
|
|
7500
7503
|
buffer.setVar("coc_git_status", status, true);
|
|
7501
|
-
nvim.
|
|
7504
|
+
nvim.callTimer("coc#util#do_autocmd", ["CocGitStatusChange"], true);
|
|
7502
7505
|
nvim.resumeNotification(false, true);
|
|
7503
7506
|
}
|
|
7504
7507
|
getSignName(changeType) {
|