mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-12 16:35:30 +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,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.types) attrs enum;
|
inherit (lib.types) attrs nullOr;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
inherit (lib.nvim.lua) mkLuaInline;
|
|
||||||
in {
|
in {
|
||||||
options.vim.formatter.conform-nvim = {
|
options.vim.formatter.conform-nvim = {
|
||||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||||
|
|
@ -31,11 +30,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format_on_save = mkOption {
|
format_on_save = mkOption {
|
||||||
type = attrs;
|
type = nullOr attrs;
|
||||||
default = {
|
default =
|
||||||
|
if config.vim.lsp.formatOnSave
|
||||||
|
then {
|
||||||
lsp_format = "fallback";
|
lsp_format = "fallback";
|
||||||
timeout_ms = 500;
|
timeout_ms = 500;
|
||||||
};
|
}
|
||||||
|
else null;
|
||||||
description = ''
|
description = ''
|
||||||
Table that will be passed to `conform.format()`. If this
|
Table that will be passed to `conform.format()`. If this
|
||||||
is set, Conform will run the formatter on save.
|
is set, Conform will run the formatter on save.
|
||||||
|
|
@ -43,8 +45,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
format_after_save = mkOption {
|
format_after_save = mkOption {
|
||||||
type = attrs;
|
type = nullOr attrs;
|
||||||
default = {lsp_format = "fallback";};
|
default =
|
||||||
|
if config.vim.lsp.formatOnSave
|
||||||
|
then {lsp_format = "fallback";}
|
||||||
|
else null;
|
||||||
description = ''
|
description = ''
|
||||||
Table that will be passed to `conform.format()`. If this
|
Table that will be passed to `conform.format()`. If this
|
||||||
is set, Conform will run the formatter asynchronously after
|
is set, Conform will run the formatter asynchronously after
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue