Skip to content

Commit 74b2003

Browse files
committed
plugins/bufferline: resolve diagnosticsUpdateInInsert deprecation
1 parent f44a209 commit 74b2003

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

plugins/bufferlines/bufferline.nix

Lines changed: 14 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"
@@ -391,7 +389,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
391389
};
392390

393391
hover = {
394-
enabled = mkEnableOption "hover";
392+
enabled = lib.mkEnableOption "hover";
395393

396394
reveal = defaultNullOpts.mkListOf types.str [ ] "reveal";
397395

@@ -413,14 +411,20 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
413411
optionSnakeCase
414412
) (oldHighlightOptions ++ [ "truncMarker" ]);
415413
in
416-
genAttrs newHighlightsOptions (
414+
lib.genAttrs newHighlightsOptions (
417415
name:
418416
defaultNullOpts.mkHighlight { } null ''
419417
Highlight group definition for ${name}.
420418
''
421419
);
422420
};
423421

422+
extraOptions = {
423+
diagnosticsUpdateInInsert = defaultNullOpts.mkBool true ''
424+
Whether diagnostics should update in insert mode.
425+
'';
426+
};
427+
424428
settingsExample = {
425429
options = {
426430
mode = "buffers";
@@ -563,6 +567,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
563567
};
564568

565569
extraConfig = cfg: {
570+
extraConfigLua =
571+
lib.optionalString (cfg.diagnosticsUpdateInInsert != null) # Lua
572+
''
573+
vim.diagnostic.config { update_in_insert = ${toString cfg.diagnosticsUpdateInInsert} }
574+
'';
575+
566576
extraPlugins = with pkgs.vimPlugins; [
567577
cfg.package
568578
nvim-web-devicons

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

Lines changed: 2 additions & 1 deletion
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";
@@ -84,7 +86,6 @@
8486
sort_by = "id";
8587
diagnostics = false;
8688
diagnostics_indicator = null;
87-
diagnostics_update_in_insert = true;
8889
offsets = null;
8990
groups = {
9091
items = [ ];

0 commit comments

Comments
 (0)