mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-16 20:24:02 +00:00
terminal/toggleterm: fix documentation rendering for literals; use mkEnableOption
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I1e58edf910815db0241e8d780cac489b6a6a6964
This commit is contained in:
parent
ffb1fb5719
commit
2a35be20e5
1 changed files with 33 additions and 10 deletions
|
|
@ -4,8 +4,8 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) nullOr enum bool package either int;
|
inherit (lib.types) nullOr enum package either int;
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
|
@ -29,15 +29,10 @@ in {
|
||||||
description = "Direction of the terminal";
|
description = "Direction of the terminal";
|
||||||
};
|
};
|
||||||
|
|
||||||
enable_winbar = mkOption {
|
enable_winbar = mkEnableOption "winbar";
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Enable winbar";
|
|
||||||
};
|
|
||||||
|
|
||||||
size = mkOption {
|
size = mkOption {
|
||||||
type = either luaInline int;
|
type = either luaInline int;
|
||||||
description = "Number or lua function which is passed to the current terminal";
|
|
||||||
default = mkLuaInline ''
|
default = mkLuaInline ''
|
||||||
function(term)
|
function(term)
|
||||||
if term.direction == "horizontal" then
|
if term.direction == "horizontal" then
|
||||||
|
|
@ -47,17 +42,38 @@ in {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
defaultText = literalExpression ''
|
||||||
|
mkLuaInline '''
|
||||||
|
function(term)
|
||||||
|
if term.direction == "horizontal" then
|
||||||
|
return 15
|
||||||
|
elseif term.direction == "vertical" then
|
||||||
|
return vim.o.columns * 0.4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'''
|
||||||
|
'';
|
||||||
|
description = "Integer or Lua function which is passed to the current terminal";
|
||||||
};
|
};
|
||||||
|
|
||||||
winbar = {
|
winbar = {
|
||||||
enabled = mkEnableOption "winbar in terminal" // {default = true;};
|
enabled = mkEnableOption "winbar in terminal" // {default = true;};
|
||||||
name_formatter = mkOption {
|
name_formatter = mkOption {
|
||||||
type = luaInline;
|
type = luaInline;
|
||||||
description = "Winbar formatter function.";
|
|
||||||
default = mkLuaInline ''
|
default = mkLuaInline ''
|
||||||
function(term)
|
function(term)
|
||||||
return term.name
|
return term.name
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
defaultText =
|
||||||
|
literalExpression
|
||||||
|
mkLuaInline '' '
|
||||||
|
function(term)
|
||||||
|
return term.name
|
||||||
|
end
|
||||||
|
'''
|
||||||
|
'';
|
||||||
|
description = "Winbar formatter function.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -73,7 +89,14 @@ in {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = nullOr package;
|
type = nullOr package;
|
||||||
default = pkgs.lazygit;
|
default = pkgs.lazygit;
|
||||||
description = "The package that should be used for lazygit. Setting it to null will attempt to use lazygit from your PATH";
|
defaultText = literalExpression "pkgs.lazygit";
|
||||||
|
description = ''
|
||||||
|
The package that should be used for lazygit.
|
||||||
|
|
||||||
|
Setting this option to `null` will instead attemp to use `lazygit`
|
||||||
|
from your {env}`PATH`
|
||||||
|
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue