Listener for whenever the active document changes?

Hi. I’m trying to get a notification whenever the active/in-focus document in a given editor changes? Is there a way to do that that I have missed? I want to use it to go forward and backward in the editor history and do some other things along those lines.

Thanks.

This is not currently supported for extensions, but I will consider it a feature request.

That’s great, thanks very much.