mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-08 08:14:33 +02:00
plugins/indent-blankline: add extraOptions option + test
This commit is contained in:
parent
7ad1288fdd
commit
1262c0d54f
2 changed files with 122 additions and 38 deletions
|
@ -246,6 +246,18 @@ in {
|
||||||
|
|
||||||
disableWarningMessage =
|
disableWarningMessage =
|
||||||
helpers.defaultNullOpts.mkBool false "Turns deprecation warning messages off.";
|
helpers.defaultNullOpts.mkBool false "Turns deprecation warning messages off.";
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Extra configuration options for indent-blankline without the 'indent_blankline_' prefix.
|
||||||
|
Example: To set 'indent_blankline_foobar' to 1, write
|
||||||
|
extraConfig = {
|
||||||
|
foobar = true;
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
|
@ -254,43 +266,49 @@ in {
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [cfg.package];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
globals = {
|
globals =
|
||||||
indent_blankline_char = cfg.char;
|
mapAttrs'
|
||||||
indent_blankline_char_blankline = cfg.charBlankline;
|
(name: nameValuePair ("indent_blankline_" + name))
|
||||||
indent_blankline_char_list = cfg.charList;
|
(
|
||||||
indent_blankline_char_list_blankline = cfg.charListBlankline;
|
{
|
||||||
indent_blankline_char_highlight_list = cfg.charHighlightList;
|
inherit (cfg) char;
|
||||||
indent_blankline_space_char_blankline = cfg.spaceCharBlankline;
|
char_blankline = cfg.charBlankline;
|
||||||
indent_blankline_space_char_highlight_list = cfg.spaceCharHighlightList;
|
char_list = cfg.charList;
|
||||||
indent_blankline_space_char_blankline_highlight_list = cfg.spaceCharBlanklineHighlightList;
|
char_list_blankline = cfg.charListBlankline;
|
||||||
indent_blankline_use_treesitter = cfg.useTreesitter;
|
char_highlight_list = cfg.charHighlightList;
|
||||||
indent_blankline_indent_level = cfg.indentLevel;
|
space_char_blankline = cfg.spaceCharBlankline;
|
||||||
indent_blankline_max_indent_increase = cfg.maxIndentIncrease;
|
space_char_highlight_list = cfg.spaceCharHighlightList;
|
||||||
indent_blankline_show_first_indent_level = cfg.showFirstIndentLevel;
|
space_char_blankline_highlight_list = cfg.spaceCharBlanklineHighlightList;
|
||||||
indent_blankline_show_trailing_blankline_indent = cfg.showTrailingBlanklineIndent;
|
use_treesitter = cfg.useTreesitter;
|
||||||
indent_blankline_show_end_of_line = cfg.showEndOfLine;
|
indent_level = cfg.indentLevel;
|
||||||
indent_blankline_show_foldtext = cfg.showFoldtext;
|
max_indent_increase = cfg.maxIndentIncrease;
|
||||||
indent_blankline_disable_with_nolist = cfg.disableWithNolist;
|
show_first_indent_level = cfg.showFirstIndentLevel;
|
||||||
indent_blankline_filetype = cfg.filetype;
|
show_trailing_blankline_indent = cfg.showTrailingBlanklineIndent;
|
||||||
indent_blankline_filetype_exclude = cfg.filetypeExclude;
|
show_end_of_line = cfg.showEndOfLine;
|
||||||
indent_blankline_buftype_exclude = cfg.buftypeExclude;
|
show_foldtext = cfg.showFoldtext;
|
||||||
indent_blankline_bufname_exclude = cfg.bufnameExclude;
|
disable_with_nolist = cfg.disableWithNolist;
|
||||||
indent_blankline_strict_tabs = cfg.strictTabs;
|
inherit (cfg) filetype;
|
||||||
indent_blankline_show_current_context = cfg.showCurrentContext;
|
filetype_exclude = cfg.filetypeExclude;
|
||||||
indent_blankline_show_current_context_start = cfg.showCurrentContextStart;
|
buftype_exclude = cfg.buftypeExclude;
|
||||||
indent_blankline_show_current_context_start_on_current_line = cfg.showCurrentContextStartOnCurrentLine;
|
bufname_exclude = cfg.bufnameExclude;
|
||||||
indent_blankline_context_char = cfg.contextChar;
|
strict_tabs = cfg.strictTabs;
|
||||||
indent_blankline_context_char_blankline = cfg.contextCharBlankline;
|
show_current_context = cfg.showCurrentContext;
|
||||||
indent_blankline_context_char_list = cfg.contextCharList;
|
show_current_context_start = cfg.showCurrentContextStart;
|
||||||
indent_blankline_context_char_list_blankline = cfg.contextCharListBlankline;
|
show_current_context_start_on_current_line = cfg.showCurrentContextStartOnCurrentLine;
|
||||||
indent_blankline_context_highlight_list = cfg.contextHighlightList;
|
context_char = cfg.contextChar;
|
||||||
indent_blankline_char_priority = cfg.charPriority;
|
context_char_blankline = cfg.contextCharBlankline;
|
||||||
indent_blankline_context_start_priority = cfg.contextStartPriority;
|
context_char_list = cfg.contextCharList;
|
||||||
indent_blankline_context_patterns = cfg.contextPatterns;
|
context_char_list_blankline = cfg.contextCharListBlankline;
|
||||||
indent_blankline_use_treesitter_scope = cfg.useTreesitterScope;
|
context_highlight_list = cfg.contextHighlightList;
|
||||||
indent_blankline_context_pattern_highlight = cfg.contextPatternHighlight;
|
char_priority = cfg.charPriority;
|
||||||
indent_blankline_viewport_buffer = cfg.viewportBuffer;
|
context_start_priority = cfg.contextStartPriority;
|
||||||
indent_blankline_disable_warning_message = cfg.disableWarningMessage;
|
context_patterns = cfg.contextPatterns;
|
||||||
};
|
use_treesitter_scope = cfg.useTreesitterScope;
|
||||||
|
context_pattern_highlight = cfg.contextPatternHighlight;
|
||||||
|
viewport_buffer = cfg.viewportBuffer;
|
||||||
|
disable_warning_message = cfg.disableWarningMessage;
|
||||||
|
}
|
||||||
|
// cfg.extraOptions
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
66
tests/test-sources/plugins/utils/indent-blankline.nix
Normal file
66
tests/test-sources/plugins/utils/indent-blankline.nix
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.indent-blankline.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins.indent-blankline = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
char = "│";
|
||||||
|
charBlankline = "";
|
||||||
|
charList = [];
|
||||||
|
charListBlankline = [];
|
||||||
|
charHighlightList = [];
|
||||||
|
spaceCharBlankline = " ";
|
||||||
|
spaceCharHighlightList = [];
|
||||||
|
spaceCharBlanklineHighlightList = [];
|
||||||
|
useTreesitter = false;
|
||||||
|
indentLevel = 10;
|
||||||
|
maxIndentIncrease = 10;
|
||||||
|
showFirstIndentLevel = true;
|
||||||
|
showTrailingBlanklineIndent = true;
|
||||||
|
showEndOfLine = false;
|
||||||
|
showFoldtext = true;
|
||||||
|
disableWithNolist = false;
|
||||||
|
filetype = [];
|
||||||
|
filetypeExclude = ["lspinfo" "packer" "checkhealth" "help" "man" ""];
|
||||||
|
buftypeExclude = ["terminal" "nofile" "quickfix" "prompt"];
|
||||||
|
bufnameExclude = [];
|
||||||
|
strictTabs = false;
|
||||||
|
showCurrentContext = false;
|
||||||
|
showCurrentContextStart = false;
|
||||||
|
showCurrentContextStartOnCurrentLine = true;
|
||||||
|
contextChar = "│";
|
||||||
|
contextCharBlankline = "";
|
||||||
|
contextCharList = [];
|
||||||
|
contextCharListBlankline = [];
|
||||||
|
contextHighlightList = [];
|
||||||
|
charPriority = 1;
|
||||||
|
contextStartPriority = 10000;
|
||||||
|
contextPatterns = [
|
||||||
|
"class"
|
||||||
|
"^func"
|
||||||
|
"method"
|
||||||
|
"^if"
|
||||||
|
"while"
|
||||||
|
"for"
|
||||||
|
"with"
|
||||||
|
"try"
|
||||||
|
"except"
|
||||||
|
"arguments"
|
||||||
|
"argument_list"
|
||||||
|
"object"
|
||||||
|
"dictionary"
|
||||||
|
"element"
|
||||||
|
"table"
|
||||||
|
"tuple"
|
||||||
|
"do_block"
|
||||||
|
];
|
||||||
|
useTreesitterScope = false;
|
||||||
|
contextPatternHighlight = {};
|
||||||
|
viewportBuffer = 10;
|
||||||
|
disableWarningMessage = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue