Skip to content

Commit 3dfb335

Browse files
committed
plugins/bufferline: resolve diagnosticsUpdateInInsert deprecation
1 parent cf25f80 commit 3dfb335

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

plugins/bufferlines/bufferline.nix

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
...
66
}:
77
let
8-
inherit (lib) mkEnableOption genAttrs;
98
inherit (lib.nixvim) defaultNullOpts nixvimTypes;
109
types = nixvimTypes;
1110

@@ -112,7 +111,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
112111
"sortBy"
113112
"diagnostics"
114113
"diagnosticsIndicator"
115-
"diagnosticsUpdateInInsert"
116114
"offsets"
117115
[
118116
"groups"
@@ -402,7 +400,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
402400
};
403401

404402
hover = {
405-
enabled = mkEnableOption "hover";
403+
enabled = lib.mkEnableOption "hover";
406404

407405
reveal = defaultNullOpts.mkListOf types.str [ ] "reveal";
408406

@@ -424,14 +422,26 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
424422
optionSnakeCase
425423
) (oldHighlightOptions ++ [ "truncMarker" ]);
426424
in
427-
genAttrs newHighlightsOptions (
425+
lib.genAttrs newHighlightsOptions (
428426
name:
429427
defaultNullOpts.mkHighlight { } null ''
430428
Highlight group definition for ${name}.
431429
''
432430
);
433431
};
434432

433+
extraOptions = {
434+
diagnosticsUpdateInInsert = lib.mkOption {
435+
type = types.bool;
436+
default = false;
437+
description = ''
438+
Whether to enable diagnostics update in insert mode.
439+
440+
Only applies when `coc` is selected in option `plugins.settings.options.diagnostic`.
441+
'';
442+
};
443+
};
444+
435445
settingsExample = {
436446
options = {
437447
mode = "buffers";
@@ -574,6 +584,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
574584
};
575585

576586
extraConfig = cfg: {
587+
extraConfigLua =
588+
lib.mkIf cfg.diagnosticsUpdateInInsert # Lua
589+
''
590+
vim.diagnostic.config { update_in_insert = true }
591+
'';
592+
577593
extraPlugins = with pkgs.vimPlugins; [
578594
cfg.package
579595
nvim-web-devicons

tests/test-sources/plugins/bufferlines/bufferline.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
defaults = {
4848
plugins.bufferline = {
4949
enable = true;
50+
diagnosticsUpdateInInsert = true;
51+
5052
settings = {
5153
options = {
5254
mode = "buffers";

0 commit comments

Comments
 (0)