Fix preview position not correct when switching back to a previously opened editor