utility/yanky-nvim: fix plugin setupOpts; assert when shada is disabled

This commit is contained in:
raf 2025-02-24 16:56:15 +03:00
commit 831a5db8fa
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 17 additions and 5 deletions

View file

@ -11,6 +11,7 @@
cfg = config.vim.utility.yanky-nvim;
usingSqlite = cfg.setupOpts.ring.storage == "sqlite";
usingShada = cfg.setupOpts.ring.storage == "shada";
in {
config = mkIf cfg.enable {
vim = {
@ -28,5 +29,15 @@ in {
require("yanky").setup(${toLuaObject cfg.setupOpts});
'';
};
assertions = [
{
assertion = usingShada && ((config.vim.options.shada or "") == "");
message = ''
Yanky.nvim is configured to use 'shada' for the storage backend, but shada is disabled
in 'vim.options'. Please re-enable shada, or switch to a different backend.
'';
}
];
};
}