mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 09:18:38 +02:00
lsp-lines: add currentLine option
This commit is contained in:
parent
a7fbb81224
commit
db8a2c0b97
2 changed files with 78 additions and 3 deletions
|
@ -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
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue