coc-git 2.5.0 → 2.5.3

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 -6
  2. package/package.json +65 -2
package/lib/index.js CHANGED
@@ -5848,6 +5848,7 @@ var DocumentManager = class {
5848
5848
  currentHlGroup: config.get("conflict.current.hlGroup", "DiffChange"),
5849
5849
  incomingHlGroup: config.get("conflict.incoming.hlGroup", "DiffAdd")
5850
5850
  },
5851
+ floatConfig: config.get("floatConfig", {}),
5851
5852
  gstatus: {
5852
5853
  saveBeforeOpen: config.get("gstatus.saveBeforeOpen", false)
5853
5854
  },
@@ -6523,6 +6524,7 @@ var resolver_default = Resolver;
6523
6524
 
6524
6525
  // src/model/buffer.ts
6525
6526
  var import_coc12 = __toModule(require("coc.nvim"));
6527
+ var import_debounce2 = __toModule(require_debounce());
6526
6528
 
6527
6529
  // node_modules/timeago.js/esm/lang/en_US.js
6528
6530
  var EN_US = ["second", "minute", "hour", "day", "week", "month", "year"];
@@ -6600,7 +6602,6 @@ register("en_US", en_US_default);
6600
6602
  register("zh_CN", zh_CN_default);
6601
6603
 
6602
6604
  // src/model/buffer.ts
6603
- var import_debounce2 = __toModule(require_debounce());
6604
6605
  var import_url = __toModule(require("url"));
6605
6606
  var signGroup = "CocGit";
6606
6607
  var GitBuffer = class {
@@ -7401,12 +7402,12 @@ var GitBuffer = class {
7401
7402
  nvim.resumeNotification(false, true);
7402
7403
  }
7403
7404
  async showDoc(content, filetype = "diff") {
7404
- if (import_coc12.workspace.floatSupported) {
7405
+ if (this.floatFactory) {
7405
7406
  let docs = [{content, filetype}];
7406
- await this.floatFactory.show(docs);
7407
+ await this.floatFactory.show(docs, this.config.floatConfig);
7407
7408
  } else {
7408
7409
  const lines = content.split("\n");
7409
- import_coc12.workspace.nvim.call("coc#util#preview_info", [lines, "diff"], true);
7410
+ import_coc12.workspace.nvim.call("coc#ui#preview_info", [lines, "diff"], true);
7410
7411
  }
7411
7412
  }
7412
7413
  setBufferStatus(status) {
@@ -7471,7 +7472,9 @@ var GitService = class {
7471
7472
  const outputChannel = this.outputChannel = import_coc13.window.createOutputChannel("git");
7472
7473
  this._git = new git_default(gitInfo, outputChannel);
7473
7474
  this._resolver = new resolver_default(this._git, outputChannel);
7474
- this.floatFactory = new import_coc13.FloatFactory(import_coc13.workspace.nvim);
7475
+ if (typeof import_coc13.window.createFloatFactory === "function") {
7476
+ this.floatFactory = import_coc13.window.createFloatFactory({modes: ["n"]});
7477
+ }
7475
7478
  }
7476
7479
  getRepoFromRoot(root) {
7477
7480
  if (this.repos.has(root)) {
@@ -7516,7 +7519,8 @@ var GitService = class {
7516
7519
  this.outputChannel.appendLine(text);
7517
7520
  }
7518
7521
  dispose() {
7519
- this.floatFactory.dispose();
7522
+ var _a;
7523
+ (_a = this.floatFactory) == null ? void 0 : _a.dispose();
7520
7524
  this._resolver.dispose();
7521
7525
  this.outputChannel.dispose();
7522
7526
  this.repos.clear();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-git",
3
- "version": "2.5.0",
3
+ "version": "2.5.3",
4
4
  "description": "Git extension for coc.nvim",
5
5
  "main": "lib/index.js",
6
6
  "publisher": "chemzqm",
@@ -290,6 +290,69 @@
290
290
  "default": false,
291
291
  "description": "Show commit in floating or popup window"
292
292
  },
293
+ "git.floatConfig": {
294
+ "type": "object",
295
+ "description": "Configure style of float window/popup, extends from floatFactory.floatConfig",
296
+ "additionalProperties": false,
297
+ "properties": {
298
+ "border": {
299
+ "type": "boolean",
300
+ "default": false,
301
+ "description": "Set to true to use borders."
302
+ },
303
+ "rounded": {
304
+ "type": "boolean",
305
+ "default": false,
306
+ "description": "Use rounded borders when border is true."
307
+ },
308
+ "highlight": {
309
+ "type": "string",
310
+ "default": "CocFloating",
311
+ "description": "Background highlight group of float window."
312
+ },
313
+ "title": {
314
+ "type": "string",
315
+ "default": "",
316
+ "description": "Title used by float window."
317
+ },
318
+ "borderhighlight": {
319
+ "type": "string",
320
+ "default": "CocFloating",
321
+ "description": "Border highlight group of float window."
322
+ },
323
+ "close": {
324
+ "type": "boolean",
325
+ "default": false,
326
+ "description": "Set to true to draw close icon"
327
+ },
328
+ "maxWidth": {
329
+ "type": "integer",
330
+ "description": "Maximum width of float window, include border."
331
+ },
332
+ "maxHeight": {
333
+ "type": "integer",
334
+ "minimum": 2,
335
+ "description": "Maximum height of float window, include border."
336
+ },
337
+ "focusable": {
338
+ "type": "boolean",
339
+ "default": true,
340
+ "description": "Enable focus by user actions (wincmds, mouse events), neovim only."
341
+ },
342
+ "shadow": {
343
+ "type": "boolean",
344
+ "default": false,
345
+ "description": "Drop shadow effect by blending with the background, neovim only."
346
+ },
347
+ "winblend": {
348
+ "type": "integer",
349
+ "default": 0,
350
+ "minimum": 0,
351
+ "maximum": 100,
352
+ "description": "Enables pseudo-transparency by set 'winblend' option of window, neovim only."
353
+ }
354
+ }
355
+ },
293
356
  "git.gitlab.hosts": {
294
357
  "type": "array",
295
358
  "default": [
@@ -364,7 +427,7 @@
364
427
  "@types/node": "^12.12.0",
365
428
  "@types/uuid": "^7.0.1",
366
429
  "@types/which": "^1.3.2",
367
- "coc.nvim": "^0.0.81-next.13",
430
+ "coc.nvim": "^0.0.83-next.2",
368
431
  "colors": "^1.4.0",
369
432
  "debounce": "^1.2.0",
370
433
  "esbuild": "^0.8.29",