modules/neovim: deprecate vim.showSignColumn

Prefer the type-safe `vim.options` equivalent.
This commit is contained in:
raf 2024-12-03 00:53:22 +03:00
parent 22148e7aaa
commit b01613568f
Signed by: NotAShelf
GPG key ID: AF26552424E53993
3 changed files with 29 additions and 25 deletions

View file

@ -14,6 +14,7 @@
splitRight = "splitright"; splitRight = "splitright";
autoIndent = "autoindent"; autoIndent = "autoindent";
wordWrap = "wrap"; wordWrap = "wrap";
showSignColumn = "signcolumn";
}; };
in { in {
imports = concatLists [ imports = concatLists [
@ -35,23 +36,28 @@ in {
vim.autopairs.enable has been removed in favor of per-plugin modules. vim.autopairs.enable has been removed in favor of per-plugin modules.
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autopairs" "type"] '' (mkRemovedOptionModule ["vim" "autopairs" "type"] ''
vim.autopairs.type has been removed in favor of per-plugin modules. vim.autopairs.type has been removed in favor of per-plugin modules.
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "enable"] '' (mkRemovedOptionModule ["vim" "autocomplete" "enable"] ''
vim.autocomplete.enable has been removed in favor of per-plugin modules. vim.autocomplete.enable has been removed in favor of per-plugin modules.
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "type"] '' (mkRemovedOptionModule ["vim" "autocomplete" "type"] ''
vim.autocomplete.type has been removed in favor of per-plugin modules. vim.autocomplete.type has been removed in favor of per-plugin modules.
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "sources"] '' (mkRemovedOptionModule ["vim" "autocomplete" "sources"] ''
vim.autocomplete.sources has been removed in favor of per-plugin modules. vim.autocomplete.sources has been removed in favor of per-plugin modules.
You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources
instead. instead.
'') '')
(mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] '' (mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] ''
vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip. vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip.
'') '')

View file

@ -58,12 +58,6 @@ in {
description = "Prevent swapfile and backupfile from being created"; description = "Prevent swapfile and backupfile from being created";
}; };
showSignColumn = mkOption {
type = bool;
default = true;
description = "Show the sign column";
};
bell = mkOption { bell = mkOption {
type = enum ["none" "visual" "on"]; type = enum ["none" "visual" "on"];
default = "none"; default = "none";
@ -117,10 +111,6 @@ in {
vim.o.undodir = ${toLuaObject cfg.undoFile.path} vim.o.undodir = ${toLuaObject cfg.undoFile.path}
''} ''}
${optionalString cfg.showSignColumn ''
vim.o.signcolumn = "yes"
''}
${optionalString cfg.preventJunkFiles '' ${optionalString cfg.preventJunkFiles ''
vim.o.swapfile = false vim.o.swapfile = false
vim.o.backup = false vim.o.backup = false

View file

@ -6,6 +6,7 @@
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.options) mkOption mkEnableOption literalMD literalExpression;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything; inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
inherit (lib.nvim.languages) toVimBool;
inherit (lib.nvim.types) dagOf; inherit (lib.nvim.types) dagOf;
inherit (lib.nvim.lua) listToLuaTable; inherit (lib.nvim.lua) listToLuaTable;
@ -221,6 +222,13 @@ in {
default = true; default = true;
description = "Enable word wrapping."; description = "Enable word wrapping.";
}; };
signcolumn = mkOption {
type = bool;
default = true;
apply = x: toVimBool x; # convert to a yes/no str
description = "Show the sign column";
};
}; };
}; };