coc-git 2.4.6 → 2.4.7
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 +17 -15
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -4862,7 +4862,6 @@ var Bcommits = class extends import_coc2.BasicList {
|
|
|
4862
4862
|
this.name = "bcommits";
|
|
4863
4863
|
this.description = "Commits of current file.";
|
|
4864
4864
|
this.defaultAction = "show";
|
|
4865
|
-
this.actions = [];
|
|
4866
4865
|
this.addAction("preview", async (item, context) => {
|
|
4867
4866
|
let {commit, root} = item.data;
|
|
4868
4867
|
let lines = [];
|
|
@@ -4877,18 +4876,20 @@ var Bcommits = class extends import_coc2.BasicList {
|
|
|
4877
4876
|
bufname: commit ? `[commit ${commit}]` : ""
|
|
4878
4877
|
}, context);
|
|
4879
4878
|
});
|
|
4880
|
-
this.addAction("show", async (item) => {
|
|
4879
|
+
this.addAction("show", async (item, ctx) => {
|
|
4881
4880
|
let {commit, root} = item.data;
|
|
4882
4881
|
if (!commit)
|
|
4883
4882
|
return;
|
|
4884
4883
|
let hasFugitive = await nvim.getVar("loaded_fugitive");
|
|
4885
4884
|
if (hasFugitive) {
|
|
4886
|
-
|
|
4885
|
+
let cmd = ctx.options.position === "tab" ? "Gtabedit" : "Gedit";
|
|
4886
|
+
await nvim.command(`${cmd} ${commit}`);
|
|
4887
4887
|
} else {
|
|
4888
|
+
let cmd = ctx.options.position === "tab" ? "tabe" : "edit";
|
|
4888
4889
|
let content = await import_coc2.runCommand(`git --no-pager show ${commit}`, {cwd: root});
|
|
4889
4890
|
let lines = content.trim().split("\n");
|
|
4890
4891
|
nvim.pauseNotification();
|
|
4891
|
-
nvim.command(
|
|
4892
|
+
nvim.command(`${cmd} +setl\\ buftype=nofile [commit ${commit}]`, true);
|
|
4892
4893
|
nvim.command("setl foldmethod=syntax nobuflisted bufhidden=wipe", true);
|
|
4893
4894
|
nvim.command("setf git", true);
|
|
4894
4895
|
nvim.call("append", [0, lines], true);
|
|
@@ -4896,7 +4897,7 @@ var Bcommits = class extends import_coc2.BasicList {
|
|
|
4896
4897
|
nvim.command(`exe 1`, true);
|
|
4897
4898
|
await nvim.resumeNotification();
|
|
4898
4899
|
}
|
|
4899
|
-
});
|
|
4900
|
+
}, {tabPersist: true});
|
|
4900
4901
|
this.addAction("view", async (item, context) => {
|
|
4901
4902
|
let {commit, root, file} = item.data;
|
|
4902
4903
|
let {window: window9, listWindow} = context;
|
|
@@ -5129,7 +5130,6 @@ var Commits = class extends import_coc4.BasicList {
|
|
|
5129
5130
|
this.name = "commits";
|
|
5130
5131
|
this.description = "Commits of current project.";
|
|
5131
5132
|
this.defaultAction = "show";
|
|
5132
|
-
this.actions = [];
|
|
5133
5133
|
this.cachedCommits = new Map();
|
|
5134
5134
|
this.addAction("preview", async (item, context) => {
|
|
5135
5135
|
let {commit, root} = item.data;
|
|
@@ -5151,13 +5151,14 @@ var Commits = class extends import_coc4.BasicList {
|
|
|
5151
5151
|
bufname: commit ? `[commit ${commit}]` : ""
|
|
5152
5152
|
}, context);
|
|
5153
5153
|
});
|
|
5154
|
-
this.addAction("show", async (item) => {
|
|
5154
|
+
this.addAction("show", async (item, ctx) => {
|
|
5155
5155
|
let {commit, root} = item.data;
|
|
5156
5156
|
if (!commit)
|
|
5157
5157
|
return;
|
|
5158
5158
|
let hasFugitive = await nvim.getVar("loaded_fugitive");
|
|
5159
5159
|
if (hasFugitive) {
|
|
5160
|
-
|
|
5160
|
+
let cmd = ctx.options.position === "tab" ? "Gtabedit" : "Gedit";
|
|
5161
|
+
await nvim.command(`${cmd} ${commit}`);
|
|
5161
5162
|
} else {
|
|
5162
5163
|
let lines = this.cachedCommits.get(commit);
|
|
5163
5164
|
if (!lines) {
|
|
@@ -5167,8 +5168,9 @@ var Commits = class extends import_coc4.BasicList {
|
|
|
5167
5168
|
lines = content.replace(/\n$/, "").split(/\r?\n/);
|
|
5168
5169
|
this.cachedCommits.set(commit, lines);
|
|
5169
5170
|
}
|
|
5171
|
+
let cmd = ctx.options.position === "tab" ? "tabe" : "edit";
|
|
5170
5172
|
nvim.pauseNotification();
|
|
5171
|
-
nvim.command(
|
|
5173
|
+
nvim.command(`${cmd} +setl\\ buftype=nofile [commit ${commit}]`, true);
|
|
5172
5174
|
nvim.command("setl foldmethod=syntax nobuflisted bufhidden=wipe", true);
|
|
5173
5175
|
nvim.command("setf git", true);
|
|
5174
5176
|
nvim.call("append", [0, lines], true);
|
|
@@ -5176,7 +5178,7 @@ var Commits = class extends import_coc4.BasicList {
|
|
|
5176
5178
|
nvim.command(`exe 1`, true);
|
|
5177
5179
|
await nvim.resumeNotification();
|
|
5178
5180
|
}
|
|
5179
|
-
});
|
|
5181
|
+
}, {tabPersist: true});
|
|
5180
5182
|
this.addAction("reset", async (item) => {
|
|
5181
5183
|
let {root, commit} = item.data;
|
|
5182
5184
|
if (!commit)
|
|
@@ -5251,7 +5253,7 @@ var Commits = class extends import_coc4.BasicList {
|
|
|
5251
5253
|
let content = await runCommand(`git --no-pager diff ${arg}`, {cwd: list[0].data.root});
|
|
5252
5254
|
let lines = content.replace(/\n$/, "").split("\n");
|
|
5253
5255
|
let winid = context.listWindow.id;
|
|
5254
|
-
let mod = context.options.position == "
|
|
5256
|
+
let mod = context.options.position == "tab" ? "below" : "above";
|
|
5255
5257
|
nvim.pauseNotification();
|
|
5256
5258
|
nvim.command("pclose", true);
|
|
5257
5259
|
nvim.command(`${mod} ${this.previewHeight}sp +setl\\ previewwindow [diff ${arg}]`, true);
|
|
@@ -5315,12 +5317,14 @@ var Gfiles = class extends import_coc5.BasicList {
|
|
|
5315
5317
|
const preferences = import_coc5.workspace.getConfiguration("coc.preferences");
|
|
5316
5318
|
let jumpCommand = preferences.get("jumpCommand", "edit");
|
|
5317
5319
|
for (let name of ["edit", "tabe", "vsplit", "split"]) {
|
|
5318
|
-
this.addAction(name, async (item) => {
|
|
5320
|
+
this.addAction(name, async (item, ctx) => {
|
|
5319
5321
|
let {root, sha, filepath, branch} = item.data;
|
|
5320
5322
|
if (!sha)
|
|
5321
5323
|
return;
|
|
5322
5324
|
if (branch == "HEAD") {
|
|
5323
5325
|
let cmd2 = name == "edit" ? jumpCommand : name;
|
|
5326
|
+
if (ctx.options.position === "tab")
|
|
5327
|
+
cmd2 = "tabe";
|
|
5324
5328
|
let fullpath = import_path2.default.join(root, filepath);
|
|
5325
5329
|
await import_coc5.workspace.jumpTo(import_coc5.Uri.file(fullpath).toString(), null, cmd2);
|
|
5326
5330
|
return;
|
|
@@ -5336,7 +5340,7 @@ var Gfiles = class extends import_coc5.BasicList {
|
|
|
5336
5340
|
nvim.command("setl buftype=nofile nomodifiable bufhidden=wipe nobuflisted", true);
|
|
5337
5341
|
nvim.command("filetype detect", true);
|
|
5338
5342
|
await nvim.resumeNotification();
|
|
5339
|
-
});
|
|
5343
|
+
}, {tabPersist: name === "edit"});
|
|
5340
5344
|
}
|
|
5341
5345
|
this.addAction("preview", async (item, context) => {
|
|
5342
5346
|
let {root, sha, filepath, branch} = item.data;
|
|
@@ -5406,7 +5410,6 @@ var GStatus = class extends import_coc6.BasicList {
|
|
|
5406
5410
|
this.name = "gstatus";
|
|
5407
5411
|
this.description = "Git status of current project";
|
|
5408
5412
|
this.defaultAction = "open";
|
|
5409
|
-
this.actions = [];
|
|
5410
5413
|
this.addLocationActions();
|
|
5411
5414
|
this.addMultipleAction("add", async (items) => {
|
|
5412
5415
|
let {root} = items[0].data;
|
|
@@ -7406,7 +7409,6 @@ function addSource(context, resolver) {
|
|
|
7406
7409
|
page_idx++;
|
|
7407
7410
|
try {
|
|
7408
7411
|
let info = await import_coc13.fetch(page_uri, {headers});
|
|
7409
|
-
console.log(JSON.stringify(info, null, 2));
|
|
7410
7412
|
if (info.length == 0) {
|
|
7411
7413
|
break;
|
|
7412
7414
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-git",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"description": "Git extension for coc.nvim",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"publisher": "chemzqm",
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
"@types/node": "^12.12.0",
|
|
356
356
|
"@types/uuid": "^7.0.1",
|
|
357
357
|
"@types/which": "^1.3.2",
|
|
358
|
-
"coc.nvim": "^0.0.81-next.
|
|
358
|
+
"coc.nvim": "^0.0.81-next.13",
|
|
359
359
|
"colors": "^1.4.0",
|
|
360
360
|
"debounce": "^1.2.0",
|
|
361
361
|
"esbuild": "^0.8.29",
|