martanne / vis

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

expose UI layout and allow it to be set from lua API #1066

Closed rnpnr closed 10 months ago

rnpnr commented 1 year ago

one use of this is to automatically set the layout on WIN_OPEN based on the width and height of existing windows.

fixes #812

ninewise commented 1 year ago

This looks interesting, but I'm not sure we want to expose this. We sort-of want to avoid having powerful window management built into vis, and this allows to develop plugins just for that. On the other hand, this might make people happy until we properly fix it with a client/server architecture.

Regardless, I need to see if I can regenerate and publish the luadoc somehow before applying this.

rnpnr commented 1 year ago

Thats a fair point. I would definitely prefer to relegate this to my window manager without needing to write a bunch of helpers. My justification for this though is that this patch simply makes it less tedious to do something that is already possible in vis. For example you could use some global variable in visrc.lua and then use :set layout with the annoyance that the variable can easily get out of sync.

Re luadoc: I definitely thought is was being automatically regenerated based on the source tree but I see that is not the case. I think it just displays the stuff in the gh-pages branch.