Skip to content

Commit f6ac618

Browse files
committed
plugins/bufferline: resolve diagnosticsUpdateInInsert deprecation
1 parent ca0feb4 commit f6ac618

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

@@ -121,7 +120,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
121120
"sortBy"
122121
"diagnostics"
123122
"diagnosticsIndicator"
124-
"diagnosticsUpdateInInsert"
125123
"offsets"
126124
[
127125
"groups"
@@ -411,7 +409,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
411409
};
412410

413411
hover = {
414-
enabled = mkEnableOption "hover";
412+
enabled = lib.mkEnableOption "hover";
415413

416414
reveal = defaultNullOpts.mkListOf types.str [ ] "reveal";
417415

@@ -433,14 +431,26 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
433431
optionSnakeCase
434432
) (oldHighlightOptions ++ [ "truncMarker" ]);
435433
in
436-
genAttrs newHighlightsOptions (
434+
lib.genAttrs newHighlightsOptions (
437435
name:
438436
defaultNullOpts.mkHighlight { } null ''
439437
Highlight group definition for ${name}.
440438
''
441439
);
442440
};
443441

442+
extraOptions = {
443+
diagnosticsUpdateInInsert = lib.mkOption {
444+
type = types.bool;
445+
default = false;
446+
description = ''
447+
Whether to enable diagnostics update in insert mode.
448+
449+
Only applies when `coc` is selected in option `plugins.settings.options.diagnostic`.
450+
'';
451+
};
452+
};
453+
444454
settingsExample = {
445455
options = {
446456
mode = "buffers";
@@ -583,6 +593,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
583593
};
584594

585595
extraConfig = cfg: {
596+
extraConfigLua =
597+
lib.mkIf cfg.diagnosticsUpdateInInsert # Lua
598+
''
599+
vim.diagnostic.config { update_in_insert = true }
600+
'';
601+
586602
extraPlugins = with pkgs.vimPlugins; [
587603
cfg.package
588604
nvim-web-devicons

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
defaults = {
5252
plugins.bufferline = {
5353
enable = true;
54+
diagnosticsUpdateInInsert = true;
55+
5456
settings = {
5557
options = {
5658
mode = "buffers";

0 commit comments

Comments
 (0)