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
}
diff --git a/src/memline.c b/src/memline.c
index e401c73..b6f0300 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -4860,7 +4860,8 @@
* (happens when all .swp files are in one directory).
*/
if (!recoverymode && buf_fname != NULL
- && !buf->b_help && !(buf->b_flags & BF_DUMMY))
+ && !buf->b_help
+ && !(buf->b_flags & (BF_DUMMY | BF_NO_SEA)))
{
int fd;
struct block0 b0;
diff --git a/src/tag.c b/src/tag.c
index 0358793..e288e4d 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -3663,7 +3663,7 @@
if (g_do_tagpreview != 0
&& curwin != curwin_save && win_valid(curwin_save))
{
- /* Return cursor to where we were */
+ // Return cursor to where we were
validate_cursor();
redraw_later(VALID);
win_enter(curwin_save, TRUE);
@@ -3675,11 +3675,23 @@
else
{
--RedrawingDisabled;
- if (postponed_split) /* close the window */
+ got_int = FALSE; // don't want entering window to fail
+
+ if (postponed_split) // close the window
{
win_close(curwin, FALSE);
postponed_split = 0;
}
+#if defined(FEAT_QUICKFIX) && defined(FEAT_TEXT_PROP)
+ else if (WIN_IS_POPUP(curwin))
+ {
+ win_T *wp = curwin;
+
+ if (win_valid(curwin_save))
+ win_enter(curwin_save, TRUE);
+ popup_close(wp->w_id);
+ }
+#endif
}
erret:
diff --git a/src/version.c b/src/version.c
index 71a14ad..7c9ba68 100644
--- a/src/version.c
+++ b/src/version.c
@@ -774,6 +774,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1813,
+/**/
1812,
/**/
1811,
diff --git a/src/vim.h b/src/vim.h
index 70fcf3a..1011be7 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -714,6 +714,7 @@
#define BF_DUMMY 0x80 // dummy buffer, only used internally
#define BF_PRESERVED 0x100 // ":preserve" was used
#define BF_SYN_SET 0x200 // 'syntax' option was set
+#define BF_NO_SEA 0x400 // no swap_exists_action (ATTENTION prompt)
/* Mask to check for flags that prevent normal writing */
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)