lsp-lines: add currentLine option

This commit is contained in:
Pedro Alves 2022-12-11 19:39:45 +00:00
parent a7fbb81224
commit db8a2c0b97
2 changed files with 78 additions and 3 deletions

View file

@ -8,10 +8,24 @@ in
options = {
plugins.lsp-lines = {
enable = mkEnableOption "lsp_lines.nvim";
currentLine = mkOption {
type = types.bool;
default = false;
description = "Show diagnostics only on current line";
};
};
};
config =
let
diagnosticConfig = {
virtual_text = false;
virtual_lines =
if cfg.currentLine then {
only_current_line = true;
} else true;
};
in
mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ];
@ -19,9 +33,7 @@ in
do
require("lsp_lines").setup()
vim.diagnostic.config({
virtual_text = false
})
vim.diagnostic.config(${ helpers.toLuaObject diagnosticConfig })
end
'';
};