comparison src/ex_docmd.c @ 30747:58592b6af4e2 v9.0.0708

patch 9.0.0708: :confirm does not work properly for a terminal buffer Commit: https://github.com/vim/vim/commit/15b314ffbb93f934b72cb71aa8f881caea026256 Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Sun Oct 9 18:53:32 2022 +0100 patch 9.0.0708: :confirm does not work properly for a terminal buffer Problem: :confirm does not work properly for a terminal buffer. Solution: Handle :confirm for a terminal buffer differently. (Yee Cheng Chin, closes #11312)
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Oct 2022 20:00:04 +0200
parents b005d7886185
children ac1f548223a5
comparison
equal deleted inserted replaced
30746:7497bddb55b3 30747:58592b6af4e2
6059 if (need_hide && !buf_hide(buf) && !forceit) 6059 if (need_hide && !buf_hide(buf) && !forceit)
6060 { 6060 {
6061 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 6061 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
6062 if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write) 6062 if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
6063 { 6063 {
6064 bufref_T bufref; 6064 # ifdef FEAT_TERMINAL
6065 6065 if (term_job_running(buf->b_term))
6066 set_bufref(&bufref, buf); 6066 {
6067 dialog_changed(buf, FALSE); 6067 if (term_confirm_stop(buf) == FAIL)
6068 if (bufref_valid(&bufref) && bufIsChanged(buf)) 6068 return;
6069 return; 6069 // Manually kill the terminal here because this command will
6070 need_hide = FALSE; 6070 // hide it otherwise.
6071 free_terminal(buf);
6072 need_hide = FALSE;
6073 }
6074 else
6075 # endif
6076 {
6077 bufref_T bufref;
6078
6079 set_bufref(&bufref, buf);
6080 dialog_changed(buf, FALSE);
6081 if (bufref_valid(&bufref) && bufIsChanged(buf))
6082 return;
6083 need_hide = FALSE;
6084 }
6071 } 6085 }
6072 else 6086 else
6073 #endif 6087 #endif
6074 { 6088 {
6075 no_write_message(); 6089 no_write_message();