-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Not possible to define custom extension for lualine #2130
Comments
I'm in the middle of migrating our lualine module to our new standards that will support this better in #2080. |
Thank you for expediting fixing this. It is very much appreciated ❤️. Unfortunately the fix isn't 100% complete. This oversight could very much be due to my lackluster example though. So a more complete example would be like this programs.nixvim = {
plugins.lualine = {
enable = true;
extensions = [
{
sections = {
lualine_a = [ {
name = "branch";
icon = "<U+F418>";
}];
lualine_y = [ "progress" ];
lualine_z = [ "location" ];
};
inactive_sections = {
lualine_x = [ "location" ];
};
filetypes = [ "fugitive" ];
}
];
};
} And the extensions section should translate to the following lua {
extensions = {
{
filetypes = { "fugitive" },
inactive_sections = { lualine_x = { "location" } },
sections = {
lualine_a = { { "branch", icon = "<U+F418>" } },
lualine_y = { "progress" },
lualine_z = { "location" },
},
},
}, But at the moment it appears to be translated to the following {
extensions = {
{
filetypes = { "fugitive" },
inactive_sections = { lualine_x = { "location" } },
sections = {
lualine_a = { { icon = "<U+F418>", name = "branch" } },
lualine_y = { "progress" },
lualine_z = { "location" },
},
},
}, |
This is likely something we would remove when refactoring the plugin, as we try to avoid having any unpredictable transformations applied to freeform options. Instead, you would have to use our "unkeyed" attrs hack: This nix attrset: {
__unkeyed-1 = "a";
__unkeyed-2 = "b";
c = "c";
d = "d";
} Produces this lua table: {
"a",
"b",
c = "c",
d = "d"
} |
@MattSturgeon I see, makes sense I guess. Thank you so much for the hint! With that I was able to produce my desired configuration. |
lualine
unstable
unstable
Description
While migrating my configuration to NixVim I discovered a limitation that prevents me from completely achieving my desired configuration.
The upstream lualine plugin allows the user to define custom extensions by providing a object in the list of extensions. See lualine documentation for details.
Unless I'm missing something this isn't currently possible.
Minimal, Reproducible Example (MRE)
The text was updated successfully, but these errors were encountered: