Fixed not able to compile and save when opening preview pane

Related to #15