mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
Make conform respect config.vim.lsp.formatOnSave
This commit is contained in:
parent
701dd911eb
commit
a184872d89
1 changed files with 16 additions and 11 deletions
|
@ -1,12 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) attrs enum;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrs nullOr;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.lua) mkLuaInline;
|
||||
in {
|
||||
options.vim.formatter.conform-nvim = {
|
||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||
|
@ -31,11 +30,14 @@ in {
|
|||
};
|
||||
|
||||
format_on_save = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
lsp_format = "fallback";
|
||||
timeout_ms = 500;
|
||||
};
|
||||
type = nullOr attrs;
|
||||
default =
|
||||
if config.vim.lsp.formatOnSave
|
||||
then {
|
||||
lsp_format = "fallback";
|
||||
timeout_ms = 500;
|
||||
}
|
||||
else null;
|
||||
description = ''
|
||||
Table that will be passed to `conform.format()`. If this
|
||||
is set, Conform will run the formatter on save.
|
||||
|
@ -43,8 +45,11 @@ in {
|
|||
};
|
||||
|
||||
format_after_save = mkOption {
|
||||
type = attrs;
|
||||
default = {lsp_format = "fallback";};
|
||||
type = nullOr attrs;
|
||||
default =
|
||||
if config.vim.lsp.formatOnSave
|
||||
then {lsp_format = "fallback";}
|
||||
else null;
|
||||
description = ''
|
||||
Table that will be passed to `conform.format()`. If this
|
||||
is set, Conform will run the formatter asynchronously after
|
||||
|
|
Loading…
Add table
Reference in a new issue