mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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
63
flake.lock
generated
63
flake.lock
generated
|
@ -1,5 +1,27 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"beautysh": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"poetry2nix": "poetry2nix",
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669854260,
|
||||||
|
"narHash": "sha256-Z8NAL3g4i5LAhxveNGJhrVDHxIBbUf1lVIy/Thr2RMU=",
|
||||||
|
"owner": "lovesegfault",
|
||||||
|
"repo": "beautysh",
|
||||||
|
"rev": "d616eb8d9d05ee4fb33de9c5521d99c3f0695d52",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lovesegfault",
|
||||||
|
"repo": "beautysh",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1667395993,
|
||||||
|
@ -45,12 +67,53 @@
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"poetry2nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"beautysh",
|
||||||
|
"utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"beautysh",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1658665240,
|
||||||
|
"narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "poetry2nix",
|
||||||
|
"rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "poetry2nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"beautysh": "beautysh",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nmdSrc": "nmdSrc"
|
"nmdSrc": "nmdSrc"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667395993,
|
||||||
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
@ -8,10 +8,24 @@ in
|
||||||
options = {
|
options = {
|
||||||
plugins.lsp-lines = {
|
plugins.lsp-lines = {
|
||||||
enable = mkEnableOption "lsp_lines.nvim";
|
enable = mkEnableOption "lsp_lines.nvim";
|
||||||
|
currentLine = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Show diagnostics only on current line";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config =
|
||||||
|
let
|
||||||
|
diagnosticConfig = {
|
||||||
|
virtual_text = false;
|
||||||
|
virtual_lines =
|
||||||
|
if cfg.currentLine then {
|
||||||
|
only_current_line = true;
|
||||||
|
} else true;
|
||||||
|
};
|
||||||
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ];
|
extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ];
|
||||||
|
|
||||||
|
@ -19,9 +33,7 @@ in
|
||||||
do
|
do
|
||||||
require("lsp_lines").setup()
|
require("lsp_lines").setup()
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config(${ helpers.toLuaObject diagnosticConfig })
|
||||||
virtual_text = false
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue