mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins: remove redundant mkRaw
apply
functions
`strLua` now does this coercion internally.
This commit is contained in:
parent
bd6aa476b8
commit
2cda50d530
15 changed files with 0 additions and 26 deletions
|
@ -125,7 +125,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
|
|
||||||
See `:help conform.format` for details.
|
See `:help conform.format` for details.
|
||||||
'';
|
'';
|
||||||
apply = v: if lib.isString v then mkRaw v else v;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
default_format_opts = defaultNullOpts.mkNullable defaultFormatSubmodule { } ''
|
default_format_opts = defaultNullOpts.mkNullable defaultFormatSubmodule { } ''
|
||||||
|
@ -143,7 +142,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
|
|
||||||
See `:help conform.format` for details.
|
See `:help conform.format` for details.
|
||||||
'';
|
'';
|
||||||
apply = v: if lib.isString v then mkRaw v else v;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
log_level = defaultNullOpts.mkLogLevel "error" ''
|
log_level = defaultNullOpts.mkLogLevel "error" ''
|
||||||
|
|
|
@ -151,7 +151,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
});
|
});
|
||||||
default = null;
|
default = null;
|
||||||
example = "require('noice.util.spinners').spinners.circleFull";
|
example = "require('noice.util.spinners').spinners.circleFull";
|
||||||
apply = v: if isString v then helpers.mkRaw v else v;
|
|
||||||
description = "Spinner for pinned views that are loading.";
|
description = "Spinner for pinned views that are loading.";
|
||||||
pluginDefault = {
|
pluginDefault = {
|
||||||
frames = defaultFrames;
|
frames = defaultFrames;
|
||||||
|
@ -182,7 +181,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
# Hence, we convert the string to raw lua in `apply`.
|
# Hence, we convert the string to raw lua in `apply`.
|
||||||
keys = helpers.defaultNullOpts.mkAttrsOf' {
|
keys = helpers.defaultNullOpts.mkAttrsOf' {
|
||||||
type = with lib.types; either strLuaFn (enum [ false ]);
|
type = with lib.types; either strLuaFn (enum [ false ]);
|
||||||
apply = x: if x == null then null else mapAttrs (_: v: if isString v then helpers.mkRaw v else v) x;
|
|
||||||
description = ''
|
description = ''
|
||||||
Buffer-local keymaps to be added to edgebar buffers.
|
Buffer-local keymaps to be added to edgebar buffers.
|
||||||
Existing buffer-local keymaps will never be overridden.
|
Existing buffer-local keymaps will never be overridden.
|
||||||
|
|
|
@ -156,7 +156,6 @@ with lib;
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
apply = mapAttrs (_: helpers.mkRaw);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,7 +91,6 @@ let
|
||||||
example = ''
|
example = ''
|
||||||
require('lint.parser').from_pattern(pattern, groups, severity_map, defaults, opts)
|
require('lint.parser').from_pattern(pattern, groups, severity_map, defaults, opts)
|
||||||
'';
|
'';
|
||||||
apply = helpers.mkRaw;
|
|
||||||
mandatory = true;
|
mandatory = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
adapters = mkOption {
|
adapters = mkOption {
|
||||||
type = with types; listOf strLua;
|
type = with types; listOf strLua;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
apply = map mkRaw;
|
|
||||||
# NOTE: We hide this option from the documentation as users should use the top-level
|
# NOTE: We hide this option from the documentation as users should use the top-level
|
||||||
# `adapters` option.
|
# `adapters` option.
|
||||||
# They can still directly append raw lua code to this `settings.adapters` option.
|
# They can still directly append raw lua code to this `settings.adapters` option.
|
||||||
|
|
|
@ -55,7 +55,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
For "static" delimiter pairs it can be a list of strings representing the value
|
For "static" delimiter pairs it can be a list of strings representing the value
|
||||||
of the delimiter pair.
|
of the delimiter pair.
|
||||||
'';
|
'';
|
||||||
apply = v: if lib.isString v then lib.nixvim.mkRaw v else v;
|
|
||||||
example = [
|
example = [
|
||||||
"( "
|
"( "
|
||||||
" )"
|
" )"
|
||||||
|
|
|
@ -226,7 +226,6 @@ with lib;
|
||||||
action = mkOption {
|
action = mkOption {
|
||||||
type = lib.types.strLua;
|
type = lib.types.strLua;
|
||||||
description = "The lua code for this keymap action.";
|
description = "The lua code for this keymap action.";
|
||||||
apply = helpers.mkRaw;
|
|
||||||
};
|
};
|
||||||
opts = helpers.keymaps.mapConfigOptions // {
|
opts = helpers.keymaps.mapConfigOptions // {
|
||||||
buffer = helpers.defaultNullOpts.mkBool false ''
|
buffer = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
|
|
@ -30,7 +30,6 @@ with lib;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
apply = v: map (listElem: if isString listElem then helpers.mkRaw listElem else listElem) v;
|
|
||||||
default = [ ];
|
default = [ ];
|
||||||
description = ''
|
description = ''
|
||||||
Startify displays lists. Each list consists of a `type` and optionally a `header` and
|
Startify displays lists. Each list consists of a `type` and optionally a `header` and
|
||||||
|
|
|
@ -129,7 +129,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
description = ''
|
description = ''
|
||||||
Builtin click handlers.
|
Builtin click handlers.
|
||||||
'';
|
'';
|
||||||
apply = mapAttrs (_: helpers.mkRaw);
|
|
||||||
example = {
|
example = {
|
||||||
Lnum = "require('statuscol.builtin').lnum_click";
|
Lnum = "require('statuscol.builtin').lnum_click";
|
||||||
FoldClose = "require('statuscol.builtin').foldclose_click";
|
FoldClose = "require('statuscol.builtin').foldclose_click";
|
||||||
|
|
|
@ -95,7 +95,6 @@ rec {
|
||||||
${defaults}
|
${defaults}
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
apply = lib.mapAttrs (_: lib.nixvim.mkRaw);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mkMappingsOption =
|
mkMappingsOption =
|
||||||
|
|
|
@ -18,7 +18,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
|
|
||||||
patterns = mkOption {
|
patterns = mkOption {
|
||||||
type = with lib.types; listOf strLua;
|
type = with lib.types; listOf strLua;
|
||||||
apply = map helpers.mkRaw;
|
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [ "[[%s/\(\n\n\)\n\+/\1/]]" ];
|
example = [ "[[%s/\(\n\n\)\n\+/\1/]]" ];
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -22,7 +22,6 @@ in
|
||||||
onAttach = helpers.defaultNullOpts.mkLuaFn "__lspOnAttach" "Lua code to run when tsserver attaches to a buffer.";
|
onAttach = helpers.defaultNullOpts.mkLuaFn "__lspOnAttach" "Lua code to run when tsserver attaches to a buffer.";
|
||||||
handlers = mkOption {
|
handlers = mkOption {
|
||||||
type = with lib.types; nullOr (attrsOf strLuaFn);
|
type = with lib.types; nullOr (attrsOf strLuaFn);
|
||||||
apply = v: helpers.ifNonNull' v (mapAttrs (_: helpers.mkRaw) v);
|
|
||||||
default = null;
|
default = null;
|
||||||
description = "How tsserver should respond to LSP requests";
|
description = "How tsserver should respond to LSP requests";
|
||||||
example = {
|
example = {
|
||||||
|
|
|
@ -43,14 +43,6 @@ with lib;
|
||||||
cmp mappings declaration.
|
cmp mappings declaration.
|
||||||
See `:h cmp-mapping` for more information.
|
See `:h cmp-mapping` for more information.
|
||||||
'';
|
'';
|
||||||
apply =
|
|
||||||
v:
|
|
||||||
# Handle the raw case first
|
|
||||||
if lib.types.isRawType v then
|
|
||||||
v
|
|
||||||
# When v is an attrs **but not {__raw = ...}**
|
|
||||||
else
|
|
||||||
mapAttrs (_: helpers.mkRaw) v;
|
|
||||||
example = {
|
example = {
|
||||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||||
|
@ -98,7 +90,6 @@ with lib;
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
apply = helpers.mkRaw;
|
|
||||||
example = ''
|
example = ''
|
||||||
function(args)
|
function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
@ -210,7 +201,6 @@ with lib;
|
||||||
|
|
||||||
comparators = mkOption {
|
comparators = mkOption {
|
||||||
type = with lib.types; nullOr (listOf strLuaFn);
|
type = with lib.types; nullOr (listOf strLuaFn);
|
||||||
apply = v: helpers.ifNonNull' v (map helpers.mkRaw v);
|
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
The function to customize the sorting behavior.
|
The function to customize the sorting behavior.
|
||||||
|
|
|
@ -162,7 +162,6 @@ in
|
||||||
|
|
||||||
action = mkOption {
|
action = mkOption {
|
||||||
type = lib.types.strLuaFn;
|
type = lib.types.strLuaFn;
|
||||||
apply = helpers.mkRaw;
|
|
||||||
description = ''
|
description = ''
|
||||||
The parameters to the action function are the different sources (currently `git`,
|
The parameters to the action function are the different sources (currently `git`,
|
||||||
`gitlab` and `github`), the completion callback, the trigger character, the
|
`gitlab` and `github`), the completion callback, the trigger character, the
|
||||||
|
|
|
@ -207,7 +207,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
|
|
||||||
default: `{}`
|
default: `{}`
|
||||||
'';
|
'';
|
||||||
apply = v: if lib.isAttrs v then lib.mapAttrs (_: lib.nixvim.mkRaw) v else v;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
request = {
|
request = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue