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.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index f79f054..98f5070 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2454,7 +2454,7 @@
/*
* 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 @@
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 @@
(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 @@
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
}