coc-git 2.7.1 → 2.7.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/lib/index.js +20 -18
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -6763,7 +6763,7 @@ var GitBuffer = class {
6763
6763
  let line = await import_coc13.workspace.nvim.call("line", ".");
6764
6764
  let diff = this.getChunk(line);
6765
6765
  if (!diff) {
6766
- import_coc13.window.showMessage("Not positioned in git chunk", "error");
6766
+ import_coc13.window.showErrorMessage("Not positioned in git chunk");
6767
6767
  return;
6768
6768
  }
6769
6769
  let head;
@@ -7103,7 +7103,7 @@ var GitBuffer = class {
7103
7103
  async diffCached() {
7104
7104
  let res = await this.repo.safeRun(["diff", "--cached"]);
7105
7105
  if (!res.trim()) {
7106
- import_coc13.window.showMessage("Empty diff");
7106
+ import_coc13.window.showWarningMessage("Empty diff");
7107
7107
  return;
7108
7108
  }
7109
7109
  let { nvim } = import_coc13.workspace;
@@ -7119,7 +7119,7 @@ var GitBuffer = class {
7119
7119
  async nextConflict() {
7120
7120
  let { nvim } = import_coc13.workspace;
7121
7121
  if (!this.conflicts.length) {
7122
- import_coc13.window.showMessage("No conflicts detected", "warning");
7122
+ import_coc13.window.showWarningMessage("No conflicts detected");
7123
7123
  return;
7124
7124
  }
7125
7125
  let line = await nvim.call("line", ".");
@@ -7136,7 +7136,7 @@ var GitBuffer = class {
7136
7136
  async prevConflict() {
7137
7137
  let { nvim } = import_coc13.workspace;
7138
7138
  if (!this.conflicts.length) {
7139
- import_coc13.window.showMessage("No conflicts detected", "warning");
7139
+ import_coc13.window.showWarningMessage("No conflicts detected", "warning");
7140
7140
  return;
7141
7141
  }
7142
7142
  let line = await nvim.call("line", ".");
@@ -7154,7 +7154,7 @@ var GitBuffer = class {
7154
7154
  const { nvim } = import_coc13.workspace;
7155
7155
  let conflicts = this.conflicts;
7156
7156
  if (!conflicts || conflicts.length == 0) {
7157
- import_coc13.window.showMessage("No conflicts detected");
7157
+ import_coc13.window.showWarningMessage("No conflicts detected");
7158
7158
  return;
7159
7159
  }
7160
7160
  let line = await nvim.call("line", ".");
@@ -7174,7 +7174,7 @@ var GitBuffer = class {
7174
7174
  }
7175
7175
  }
7176
7176
  }
7177
- import_coc13.window.showMessage("Not positioned on a conflict");
7177
+ import_coc13.window.showWarningMessage("Not positioned on a conflict");
7178
7178
  }
7179
7179
  async browser(action = "open", range, permalink = false) {
7180
7180
  let { nvim } = import_coc13.workspace;
@@ -7197,7 +7197,7 @@ var GitBuffer = class {
7197
7197
  }
7198
7198
  let output = await this.repo.safeRun(["remote"]);
7199
7199
  if (!output.trim()) {
7200
- import_coc13.window.showMessage(`No remote found`, "warning");
7200
+ import_coc13.window.showWarningMessage(`No remote found`);
7201
7201
  return;
7202
7202
  }
7203
7203
  let names = output.trim().split(/\r?\n/);
@@ -7206,7 +7206,7 @@ var GitBuffer = class {
7206
7206
  if (names.includes(browserRemoteName)) {
7207
7207
  names = [browserRemoteName];
7208
7208
  } else {
7209
- import_coc13.window.showMessage("Configured git.browserRemoteName missing from remote list", "warning");
7209
+ import_coc13.window.showWarningMessage("Configured git.browserRemoteName missing from remote list");
7210
7210
  return;
7211
7211
  }
7212
7212
  }
@@ -7231,16 +7231,17 @@ var GitBuffer = class {
7231
7231
  await import_coc13.workspace.openResource(urls[0]);
7232
7232
  } else {
7233
7233
  nvim.command(`let @+ = '${urls[0]}'`, true);
7234
- import_coc13.window.showMessage("Copied url to clipboard");
7234
+ import_coc13.window.showInformationMessage("Copied url to clipboard");
7235
7235
  }
7236
7236
  } else if (urls.length > 1) {
7237
- let idx = await import_coc13.window.showQuickpick(urls, "Select url:");
7238
- if (idx >= 0) {
7237
+ let url = await import_coc13.window.showQuickPick(urls, { canPickMany: false, title: "Pick remote url" });
7238
+ if (url) {
7239
7239
  if (action == "open") {
7240
- await import_coc13.workspace.openResource(urls[idx]);
7240
+ await import_coc13.workspace.openResource(url);
7241
7241
  } else {
7242
- nvim.command(`let @+ = '${urls[idx]}'`, true);
7243
- import_coc13.window.showMessage("Copied url to clipboard");
7242
+ nvim.command(`let @+ = '${url}'`, true);
7243
+ nvim.command(`let @* = '${url}'`, true);
7244
+ import_coc13.window.showInformationMessage("Copied url to clipboard");
7244
7245
  }
7245
7246
  }
7246
7247
  }
@@ -7366,7 +7367,7 @@ var GitBuffer = class {
7366
7367
  async parseConflicts() {
7367
7368
  if (!this.hasConflicts || !this.config.conflict.enabled) return;
7368
7369
  const lines = this.doc.getLines();
7369
- const revPattern = "([0-9A-Za-z_.:/]+)";
7370
+ const revPattern = "([0-9A-Za-z_.:/-]+)";
7370
7371
  const startPattern = new RegExp(`^<{7} (${revPattern})(:? .+)?$`);
7371
7372
  const sepPattern = new RegExp(`^={7}$`);
7372
7373
  const endPattern = new RegExp(`^>{7} (${revPattern})(:? .+)?$`);
@@ -7442,19 +7443,20 @@ var GitBuffer = class {
7442
7443
  let { nvim } = import_coc13.workspace;
7443
7444
  nvim.pauseNotification();
7444
7445
  buffer.clearNamespace(this.config.conflictSrcId, 0, -1);
7446
+ const srcId = this.config.conflictSrcId;
7445
7447
  conflicts.map((conflict) => {
7446
7448
  buffer.addHighlight({
7447
7449
  hlGroup: currentHlGroup,
7448
7450
  line: conflict.start,
7449
7451
  colStart: 0,
7450
7452
  colEnd: 1e4,
7451
- srcId: this.config.conflictSrcId
7453
+ srcId
7452
7454
  });
7453
7455
  for (let line = conflict.start - 1; line < conflict.sep - 1; line++) {
7454
- buffer.addHighlight({ hlGroup: currentHlGroup, line, srcId: this.config.conflictSrcId });
7456
+ buffer.addHighlight({ hlGroup: currentHlGroup, line, srcId });
7455
7457
  }
7456
7458
  for (let line = conflict.end - 1; line >= conflict.sep; line--) {
7457
- buffer.addHighlight({ hlGroup: incomingHlGroup, line, srcId: this.config.conflictSrcId });
7459
+ buffer.addHighlight({ hlGroup: incomingHlGroup, line, srcId });
7458
7460
  }
7459
7461
  });
7460
7462
  nvim.resumeNotification(false, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-git",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Git extension for coc.nvim",
5
5
  "main": "lib/index.js",
6
6
  "publisher": "chemzqm",