Compare commits

..

2 commits

Author SHA1 Message Date
NotAShelf
a1785d546c
Merge 38355d2dfe into ebe0d6c960 2024-04-26 23:26:39 +00:00
38355d2dfe
h 2024-04-27 02:25:55 +03:00
2 changed files with 14 additions and 117 deletions

View file

@ -77,7 +77,8 @@ in rec {
else "[${toLuaObject n}] = " + (toLuaObject v)) else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs (filterAttrs
( (
_: v: (toLuaObject v != "{}") _: v:
(v != null) && (toLuaObject v != "{}")
) )
args))) args)))
+ "}" + "}"

View file

@ -1,6 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) enum bool either nullOr str int listOf; inherit (lib.types) enum bool either nullOr str int;
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption luaInline; inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in { in {
@ -57,40 +57,34 @@ in {
}; };
right_mouse_command = mkOption { right_mouse_command = mkOption {
type = nullOr (either str luaInline); type = either str luaInline;
default = "vertical sbuffer %d"; default = lib.generators.mkLuaInline "vertical sbuffer %d";
description = "Command to run when right clicking a buffer"; description = "Command to run when right clicking a buffer";
}; };
middle_mouse_command = mkOption { middle_mouse_command = mkOption {
type = nullOr (either str luaInline); type = either str luaInline;
default = null; default = null;
description = "Command to run when middle clicking a buffer"; description = "Command to run when middle clicking a buffer";
}; };
indicator = { indicator = {
icon = mkOption { icon = mkOption {
type = nullOr str; type = str;
default = null; default = "";
description = '' description = "Enable icon for indicator";
The indicatotor icon to use for current buffer.
::: {.warning}
This **must** be ommitted while style is not `icon`
:::
'';
}; };
style = mkOption { style = mkOption {
type = enum ["icon" "underline" "none"]; type = enum ["icon" "underline" "none"];
default = "underline"; default = "icon";
description = "Style for indicator"; description = "Style for indicator";
}; };
}; };
buffer_close_icon = mkOption { buffer_close_icon = mkOption {
type = str; type = str;
default = " 󰅖 "; default = "󰅖";
description = "Icon for close button"; description = "Icon for close button";
}; };
@ -102,7 +96,7 @@ in {
close_icon = mkOption { close_icon = mkOption {
type = str; type = str;
default = " "; default = "";
description = "Icon for close button"; description = "Icon for close button";
}; };
@ -175,8 +169,8 @@ in {
function(count, level, diagnostics_dict, context) function(count, level, diagnostics_dict, context)
local s = " " local s = " "
for e, n in pairs(diagnostics_dict) do for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and " " local sym = e == "error" and " "
or (e == "warning" and " " or " " ) or (e == "warning" and " " or "" )
s = s .. n .. sym s = s .. n .. sym
end end
return s return s
@ -233,104 +227,6 @@ in {
default = true; default = true;
description = "Whether or not to add filetype icon highlights"; description = "Whether or not to add filetype icon highlights";
}; };
show_buffer_icons = mkOption {
type = bool;
default = true;
description = "Whether or not to show buffer icons";
};
show_buffer_close_icons = mkOption {
type = bool;
default = true;
description = "Whether or not to show buffer close icons";
};
show_close_icon = mkOption {
type = bool;
default = true;
description = "Whether or not to show close icon";
};
show_tab_indicators = mkOption {
type = bool;
default = true;
description = "Whether or not to show tab indicators";
};
show_duplicate_prefix = mkOption {
type = bool;
default = true;
description = "Whether or not to show duplicate prefix";
};
duplicates_across_groups = mkOption {
type = bool;
default = true;
description = "Whether to consider duplicate paths in different groups as duplicates";
};
persist_buffer_sort = mkOption {
type = bool;
default = true;
description = "Whether or not custom sorted buffers should persist";
};
move_wraps_at_ends = mkOption {
type = bool;
default = false;
description = "Whether or not the move command \"wraps\" at the first or last position";
};
seperator_style = mkOption {
type = either (enum ["thick" "thin" "slope" "slant"]) (listOf str);
default = [" " " "];
description = ''
Style of the buffer separator.
Can be either one of the suspported values, or a list containing
**at most** two elements for `focused` and `unfocused` respectively.
'';
};
enforce_regular_tabs = mkOption {
type = bool;
default = false;
description = "Whether to enforce regular tabs";
};
always_show_bufferline = mkOption {
type = bool;
default = true;
description = "Whether to always show bufferline";
};
auto_toggle_bufferline = mkOption {
type = bool;
default = false;
description = "Whether to auto toggle bufferline";
};
hover = {
enabled = mkEnableOption "hover" // {default = true;};
delay = mkOption {
type = int;
default = 200;
description = "Delay for hover, in ms";
};
reveal = mkOption {
type = listOf str;
default = ["close"];
description = "Reveal hover window";
};
};
sort_by = mkOption {
type = either (enum ["insert_after_current" "insert_at_end" "id" "extension" "relative_directory" "directory" "tabs"]) luaInline;
default = "extension";
description = "Method to sort buffers by. Must be one of the supported valuees, or an inline Lua value.";
};
}; };
}; };
} }