Repository navigation
[idea] Allow layout.updated as a plugin [[events]] hook #5008
vigneshwerv
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
idea / problem
I maintain a plugin that resizes the focused pane to the golden ratio of its tab. It's triggered off
pane.focusedevents.One issue with this is that moving the focused pane left or right relocates it inside the tab without triggering the
pane.focusedevent. The pane maintains the size of the pane it replaced (so, narrower). Understandably so, since focus doesn't change. Jumping to another pane and back fixes it.To reproduce, split a tab in two, move focus to one pane, and subscribe to
pane.focused:{"id":"s","method":"events.subscribe","params":{"subscriptions":[ {"type":"pane.focused"},{"type":"layout.updated"}]}}Then move the focused pane:
The swap reports
changed: true. Only thelayout_updatedevent's fired.layout.updatedis a validevents.subscribesubscription. However, its is not a valid[[events]]manifest hook. Comparing the declared 27 subscriptions to valid[[events]]manifest values, 5 are rejected with anunknown eventerror:requested change
Allow
layout.updatedas a manifest[[events]]hook.A layout hook also covers splits and closes. Both change a pane's share of the tab while focus stays put.
why you want this
A plugin that auto-sizes panes is incomplete without the layout events.
All reactions