Easily switch between source mode <-> live preview <-> preview

Like this:

app.workspace.activeLeaf.view.editor.focus()

You might also find some useful concepts in the post I just made here:

1 Like