-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
statusline/lualine: extensible sections #173
Conversation
This adds extraActiveSection and extraInactiveSection to the lualine options to make it possible to easily extend the defaults with additional sections. We're also changing the exposed type of the *activeSection attributes from `str` to `listOf str`.
(1.) is not really a problem. Breaking changes to be expected, such is the nature of improvement. I'll make a pinned issue describing the changes. For (2.), it really is difficult to convert Nix to Lua in a way that it looks pretty. We already have some lua helpers, on top of the one in nixpkgs, and I am yet to see a converter that can make generated lua look good. We can think about the conversion method a little more, but as long as it's functional we should be good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Minor nitpick regarding the location of the function and type definitions, should be good afterwards.
statusline/lualine: extensible sections
I have a usecase where I need to add an additional source to a section in the statusline. Since repeating and then extending the current defaults isn't very convenient, I've changed the type of
activeSection
s andinactiveSection
s attributes tolistOf str
, addedextraActiveSection
andextraInactiveSection
of the same type and then create a lua table from the concatentation of both settings in the config.I immediately see two issues with this:
I'm not sure if (1.) is a problem. You're on 0.x still so I assume it's justifiable, but I'm of course willing to adapt this PR if you prefer a proper deprecation process or to keep the existing types.
For (2.) I think this somewhat is the nature of Nix but again I am willing to explore alternatives.