martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 260 forks source link

[Feature Request]: status line introspection (get status bar state via Lua API) #1179

Closed dther closed 2 months ago

dther commented 2 months ago

What feature would you like to see?

I like vis' default status line, but would like to add a bit of extra contextual information. The problem is, there isn't a way to simply "append" to the current status line. In order to add this information, I need to copy and paste the entire status bar code from vis-std, place it in my vis path, and then from there, I can set the status line to include new information.

I'd like a way to access the current contents of a window's status line as two strings (left and right) returned by the WIN_STATUS event, or from a method in the Window class.

This doesn't sound difficult, so I intend to make a PR for this once I have a prototype. I submit this issue to avoid duplication of work. Reply if you're working on something similar.

dther commented 2 months ago

On second thought, never mind. I copied the code anyway in order to give myself better control over several aspects I wanted to improve, and at that point it wasn't hard at all to simply keep track of "statusleft" and "statusright" as members of Win.