mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-21 11:21:19 +00:00
Compare commits
2 commits
1f8a44c432
...
a3051d49aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3051d49aa | ||
|
|
acbeb26854 |
2 changed files with 39 additions and 33 deletions
|
|
@ -28,18 +28,9 @@ in {
|
|||
end
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
})
|
||||
(mkIf (cfg.enable && cfg.lint_after_save) {
|
||||
vim = {
|
||||
augroups = [{name = "nvf_nvim_lint";}];
|
||||
autocmds = [
|
||||
{
|
||||
event = ["BufWritePost"];
|
||||
callback = mkLuaInline ''
|
||||
function(args)
|
||||
local ft = vim.api.nvim_get_option_value("filetype", { buf = args.buf })
|
||||
|
||||
function nvf_lint(buf)
|
||||
local ft = vim.api.nvim_get_option_value("filetype", { buf = buf })
|
||||
local linters = require("lint").linters
|
||||
local linters_from_ft = require("lint").linters_by_ft[ft]
|
||||
|
||||
|
|
@ -73,6 +64,19 @@ in {
|
|||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
})
|
||||
(mkIf (cfg.enable && cfg.lint_after_save) {
|
||||
vim = {
|
||||
augroups = [{name = "nvf_nvim_lint";}];
|
||||
autocmds = [
|
||||
{
|
||||
event = ["BufWritePost"];
|
||||
callback = mkLuaInline ''
|
||||
function(args)
|
||||
nvf_lint(args.buf)
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ builtins.mapAttrs
|
|||
Channel = getZip;
|
||||
Tarball = getUrl;
|
||||
}
|
||||
.${spec.type}
|
||||
.${
|
||||
spec.type
|
||||
}
|
||||
or (builtins.throw "Unknown source type ${spec.type}");
|
||||
in
|
||||
spec // {outPath = mayOverride (func spec);}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue