close window when leave current buffer