I feel like the new code is likely to have the problem in this comment, that the state isn't quite restored correctly - but unfortunately the comment does not specify what "all sorts" is. I think it would be things like forgetting expanded tree nodes, losing scroll position in the editor, losing cursor position, and things of that nature. Have we done some testing for regressions in this area? Basically generate some state in the editor (like unsaved file, scroll position, cursor position, etc.) and then switch to another plugin and back, and be sure it looks unchanged.