-
Notifications
You must be signed in to change notification settings - Fork 12
feat: custom status line hints #21
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
Conversation
|
I will try to get to this this evening. My initial gut reaction to this is "do we really need a way to set things in the statusline?" though lol. A quick read through the code and it looks fine. If I am understanding what it is doing properly, this is generating a statusline compatible string for you but not inserting it into the statusline. Is that correct? As an additional question, is there currently a way to retrieve this statusline hint without the statusline specific string wrapping? I am thinking about lualine users which would just want the literal string to embed in their lualine since lualine performs the proper statusline "wrapping" for them. If my understanding is correct, this would not be usable with something like lualine. I will find out tonight, but you may have an answer before then :) |
There's already a way, but there was only a way to put auto generated hints in the status line. this just adds support for custom hint strings.
It can do both. If you pass a
there's the There is no way to get it without the wrapping. |
|
Perfect! I'll give this the ole once over after work but my quick glance through, it all looked good :) |
|
I don't use the statusline mode as is so I cannot speak to how well this works in comparison to that. I do wonder if it makes sense to replace the "non-manual" version with something that just talks to this instead (to avoid duplicate/similar logic). Thoughts on that? I could be completely off base as well. Outside that, this looks good. Once I hear your thoughts on my question I have no issue merging this :) |
like some code that generates a default hint string (something like: That could be nice, but this would kinda flip some of the current inheritance on its head I think. I can look into it maybe later today or tomorrow, but I'd be okay with merging it in its current state as well. |
|
Ya I am just thinking, we currently have 2 ways to generate statusline text. Acknowledging my little knowledge there I figure it makes sense that we have 1 way to generate statusline text and the wrap that with something to auto inject it into the statusbar or whatever the "auto" statusline config option does. For now this is fine, but it probably makes sense to clean that cruft up a bit. In either case, I am fine merging this :) |

closes #20
Features
hintto a hydra whenconfig.hint.type = "statusline". The hint is parsed and highlighted using the same rules as window hints"statuslinemanual"hint type to enable passing a hint string while not automatically showing a hint in the status line (the same way settingconfig.hint = falsedoes for a normal auto generated status line. Issue is when you pass a hint, the type is assumed to bewindow, so we need this new type if we don't want to change behavior).Done in two steps if you would like to review the PR that way:
This PR also fixes a few README problems that I found, and adds an
.editorconfigfile b/c the majority of the codebase uses 3-space tabs so I'm setting that as the default.This PR does not currently append unused heads to the end of a manual status line hint. I can add that I guess if we care to be consistent.
Example of what you can now do:
TODO: