Fix histories for viewspaces are mixed
Since we store history globally in the mainwindow, history gets messed if you have two or more viewspaces. With this change, history will be maintained per viewspace.
Since we store history globally in the mainwindow, history gets messed if you have two or more viewspaces. With this change, history will be maintained per viewspace.