Mercurial > vim
diff src/ex_cmds.c @ 17632:5278e5a2a4e3 v8.1.1813
patch 8.1.1813: ATTENTION prompt for a preview popup window
commit https://github.com/vim/vim/commit/2debf1c16b93f8693a785f675320d9e949c96a97
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 4 20:44:19 2019 +0200
patch 8.1.1813: ATTENTION prompt for a preview popup window
Problem: ATTENTION prompt for a preview popup window.
Solution: Close the popup window if aborting the buffer load. Avoid getting
the ATTENTION dialog.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Aug 2019 20:45:05 +0200 |
parents | 65a8099fc0e8 |
children | 9efb4dda9720 |
line wrap: on
line diff
--- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2454,7 +2454,7 @@ do_wqall(exarg_T *eap) /* * Check the 'write' option. - * Return TRUE and give a message when it's not st. + * Return TRUE and give a message when it's not set. */ int not_writing(void) @@ -3118,6 +3118,12 @@ do_ecmd( topline = curwin->w_topline; if (!oldbuf) /* need to read the file */ { +#ifdef FEAT_TEXT_PROP + // Don't use the swap-exists dialog for a popup window, can't edit + // the buffer. + if (WIN_IS_POPUP(curwin)) + curbuf->b_flags |= BF_NO_SEA; +#endif swap_exists_action = SEA_DIALOG; curbuf->b_flags |= BF_CHECK_RO; /* set/reset 'ro' flag */ @@ -3131,6 +3137,9 @@ do_ecmd( (void)open_buffer(FALSE, eap, readfile_flags); #endif +#ifdef FEAT_TEXT_PROP + curbuf->b_flags &= ~BF_NO_SEA; +#endif if (swap_exists_action == SEA_QUIT) retval = FAIL; handle_swap_exists(&old_curbuf); @@ -3173,7 +3182,7 @@ do_ecmd( maketitle(); #endif #ifdef FEAT_TEXT_PROP - if (popup_is_popup(curwin) && curwin->w_p_pvw) + if (WIN_IS_POPUP(curwin) && curwin->w_p_pvw && retval != FAIL) popup_set_title(curwin); #endif }