coc-git 2.5.3 → 2.5.4
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/Readme.md +2 -0
- package/lib/index.js +8 -3
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -117,6 +117,8 @@ In your vim/neovim, run command:
|
|
|
117
117
|
|
|
118
118
|
- `git.showCommitInFloating`: Show commit in floating or popup window, default: `false`
|
|
119
119
|
|
|
120
|
+
- `git.floatConfig`: Configure style of float window/popup, extends from floatFactory.floatConfig
|
|
121
|
+
|
|
120
122
|
- `git.gitlab.hosts`: Custom GitLab hosts, default: `["gitlab.com"]`
|
|
121
123
|
|
|
122
124
|
- `git.conflict.enabled`: Enable highlight conflict lines, default: `true`
|
package/lib/index.js
CHANGED
|
@@ -6172,7 +6172,7 @@ var Repo = class {
|
|
|
6172
6172
|
return "";
|
|
6173
6173
|
}
|
|
6174
6174
|
}
|
|
6175
|
-
async getDiff(relFilepath, content, revision = "") {
|
|
6175
|
+
async getDiff(relFilepath, content, revision = "", encoding = "utf8") {
|
|
6176
6176
|
if (relFilepath.startsWith(`.git${import_path4.default.sep}`))
|
|
6177
6177
|
return;
|
|
6178
6178
|
let fullpath = import_path4.default.join(this.root, relFilepath);
|
|
@@ -6183,7 +6183,7 @@ var Repo = class {
|
|
|
6183
6183
|
let indexed = await this.isIndexed(relFilepath);
|
|
6184
6184
|
if (!indexed)
|
|
6185
6185
|
return;
|
|
6186
|
-
let res = await this.exec(["--no-pager", "show", `${revision}:${toUnixSlash(relFilepath)}`]);
|
|
6186
|
+
let res = await this.exec(["--no-pager", "show", `${revision}:${toUnixSlash(relFilepath)}`], {encoding});
|
|
6187
6187
|
if (!res.stdout)
|
|
6188
6188
|
return;
|
|
6189
6189
|
staged = res.stdout.replace(/\r?\n$/, "").split(/\r?\n/).join("\n");
|
|
@@ -6631,6 +6631,9 @@ var GitBuffer = class {
|
|
|
6631
6631
|
this.hasConflicts = hasConflicts;
|
|
6632
6632
|
this.refresh();
|
|
6633
6633
|
});
|
|
6634
|
+
this.doc.buffer.getOption("fileencoding").then((encoding) => {
|
|
6635
|
+
this.encoding = encoding;
|
|
6636
|
+
});
|
|
6634
6637
|
}
|
|
6635
6638
|
get cachedDiffs() {
|
|
6636
6639
|
return this.diffs;
|
|
@@ -6891,7 +6894,9 @@ var GitBuffer = class {
|
|
|
6891
6894
|
let {nvim} = import_coc12.workspace;
|
|
6892
6895
|
let revision = this.config.diffRevision;
|
|
6893
6896
|
const {bufnr} = this.doc;
|
|
6894
|
-
|
|
6897
|
+
let content = this.doc.content;
|
|
6898
|
+
let eol = this.doc.textDocument["eol"];
|
|
6899
|
+
const diffs = await this.repo.getDiff(this.relpath, eol ? content : content + "\n", revision, this.encoding || "utf8");
|
|
6895
6900
|
if (diffs == null) {
|
|
6896
6901
|
if (((_a = this.currentSigns) == null ? void 0 : _a.length) > 0) {
|
|
6897
6902
|
this.currentSigns = [];
|