Fix confirmation dialog when exiting editor (#1756)