coc-git 2.7.5 → 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.
Files changed (2) hide show
  1. package/lib/index.js +10 -9
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -6881,15 +6881,11 @@ var GitBuffer = class {
6881
6881
  let content = diff.head + "\n" + diff.lines.join("\n");
6882
6882
  await this.showDoc(content, "diff");
6883
6883
  } else {
6884
- let chunks;
6884
+ let chunks = [];
6885
6885
  try {
6886
6886
  let stagedDiff = await this.repo.getStagedChunks(this.relpath);
6887
6887
  chunks = Object.values(stagedDiff)[0];
6888
6888
  } catch (e) {
6889
- return;
6890
- }
6891
- if (!chunks.length) {
6892
- return;
6893
6889
  }
6894
6890
  let adjust = 0;
6895
6891
  for (let diff2 of this.diffs) {
@@ -6904,6 +6900,8 @@ var GitBuffer = class {
6904
6900
  if (chunk) {
6905
6901
  let content = "Staged changes\n" + chunk.lines.join("\n");
6906
6902
  await this.showDoc(content, "diff");
6903
+ } else {
6904
+ await this.showCommit(true);
6907
6905
  }
6908
6906
  }
6909
6907
  }
@@ -6976,6 +6974,7 @@ var GitBuffer = class {
6976
6974
  if (((_a = this.currentSigns) == null ? void 0 : _a.length) > 0) {
6977
6975
  this.currentSigns = [];
6978
6976
  nvim.call("sign_unplace", [signGroup, { buffer: bufnr }], true);
6977
+ nvim.redrawVim();
6979
6978
  }
6980
6979
  return;
6981
6980
  }
@@ -6987,6 +6986,7 @@ var GitBuffer = class {
6987
6986
  this.setBufferStatus("");
6988
6987
  if (this.config.enableGutters) {
6989
6988
  nvim.call("sign_unplace", [signGroup, { buffer: bufnr }], true);
6989
+ nvim.redrawVim();
6990
6990
  }
6991
6991
  this.currentSigns = [];
6992
6992
  } else {
@@ -7051,7 +7051,7 @@ var GitBuffer = class {
7051
7051
  let name = this.getSignName(sign.changeType);
7052
7052
  nvim.call("sign_place", [0, signGroup, name, bufnr, { lnum: sign.lnum, priority: signPriority }], true);
7053
7053
  }
7054
- nvim.resumeNotification(false, true);
7054
+ nvim.resumeNotification(true, true);
7055
7055
  }
7056
7056
  async loadBlames() {
7057
7057
  if (!this.showBlame) return;
@@ -7264,7 +7264,7 @@ var GitBuffer = class {
7264
7264
  }
7265
7265
  }
7266
7266
  // show commit of current line in split window
7267
- async showCommit() {
7267
+ async showCommit(useFloating = false) {
7268
7268
  let indexed = await this.repo.isIndexed(this.relpath);
7269
7269
  if (!indexed) {
7270
7270
  import_coc13.window.showWarningMessage(`"${this.relpath}" not indexed.`);
@@ -7281,7 +7281,7 @@ var GitBuffer = class {
7281
7281
  import_coc13.window.showWarningMessage("not committed yet!");
7282
7282
  return;
7283
7283
  }
7284
- let useFloating = this.config.showCommitInFloating;
7284
+ if (!useFloating) useFloating = this.config.showCommitInFloating;
7285
7285
  if (useFloating) {
7286
7286
  let content = await this.repo.safeRun(["--no-pager", "show", commit]);
7287
7287
  if (content == null) return;
@@ -7384,6 +7384,7 @@ var GitBuffer = class {
7384
7384
  let { nvim } = import_coc13.workspace;
7385
7385
  if (!enabled) {
7386
7386
  nvim.call("sign_unplace", [signGroup, { buffer: this.doc.bufnr }], true);
7387
+ nvim.redrawVim();
7387
7388
  } else {
7388
7389
  this.diffs = [];
7389
7390
  await this.diffDocument(true);
@@ -7500,7 +7501,7 @@ var GitBuffer = class {
7500
7501
  let buffer = nvim.createBuffer(this.doc.bufnr);
7501
7502
  nvim.pauseNotification();
7502
7503
  buffer.setVar("coc_git_status", status, true);
7503
- nvim.call("coc#util#do_autocmd", ["CocGitStatusChange"], true);
7504
+ nvim.callTimer("coc#util#do_autocmd", ["CocGitStatusChange"], true);
7504
7505
  nvim.resumeNotification(false, true);
7505
7506
  }
7506
7507
  getSignName(changeType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-git",
3
- "version": "2.7.5",
3
+ "version": "2.7.6",
4
4
  "description": "Git extension for coc.nvim",
5
5
  "main": "lib/index.js",
6
6
  "publisher": "chemzqm",