Closed benibenj closed 1 week ago
Also, I need to make sure it's correctly handled when the active group changes which is not the case currently. I wonder if we can solve this from the EditorPart. It could listen on active group change and then set the global contextkeys to the scoped ones. Not sure its possible in a nice way... Otherwise, the editor group view just needs to rerun observeActiveEditor
when it becomes active.
Also, I need to make sure it's correctly handled when the active group changes which is not the case currently. I wonder if we can solve this from the EditorPart. It could listen on active group change and then set the global contextkeys to the scoped ones. Not sure its possible in a nice way... Otherwise, the editor group view just needs to rerun
observeActiveEditor
when it becomes active.
Yeah you need to keep track of active group changes and then go over all context keys that have been bound and ask for the scoped context key value to update the global one.
Btw EditorPart
is per window and each window can have an active editor group. But only EditorParts
has the true single active editor group, so maybe this actually needs to be managed by EditorParts
so that we are not updating the global context key from multiple windows.
That is why bind
is not on the service, so others don't use it, but it's hard to fully restrict it to the outside. The next step (other PR ideally) will be to have a method on the service which allows others to register a context key handler. This will then be managed correctly across all groups.
This pull request includes changes to clean up the editor group context keys.