patch 8.1.1431: popup window listed as "Scratch"
Problem: Popup window listed as "Scratch".
Solution: List them as "Popup".
diff --git a/src/buffer.c b/src/buffer.c
index ea61c5a..3bfb639 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5782,6 +5782,10 @@
if (bt_prompt(buf))
return (char_u *)_("[Prompt]");
#endif
+#ifdef FEAT_TEXT_PROP
+ if (bt_popup(buf))
+ return (char_u *)_("[Popup]");
+#endif
return (char_u *)_("[Scratch]");
}
diff --git a/src/popupwin.c b/src/popupwin.c
index ef4609a..f828d91 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -550,6 +550,7 @@
if (wp != NULL && (wp->w_popup_flags & POPF_HIDDEN) == 0)
{
wp->w_popup_flags |= POPF_HIDDEN;
+ --wp->w_buffer->b_nwindows;
redraw_all_later(NOT_VALID);
}
}
@@ -566,6 +567,7 @@
if (wp != NULL && (wp->w_popup_flags & POPF_HIDDEN) != 0)
{
wp->w_popup_flags &= ~POPF_HIDDEN;
+ ++wp->w_buffer->b_nwindows;
redraw_all_later(NOT_VALID);
}
}
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index c5fdb6e..29d4c15 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -196,12 +196,16 @@
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('world', line)
call assert_equal(1, popup_getpos(winid).visible)
+ " buffer is still listed and active
+ call assert_match(winbufnr(winid) .. 'u a.*\[Popup\]', execute('ls u'))
call popup_hide(winid)
redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('hello', line)
call assert_equal(0, popup_getpos(winid).visible)
+ " buffer is still listed but hidden
+ call assert_match(winbufnr(winid) .. 'u h.*\[Popup\]', execute('ls u'))
call popup_show(winid)
redraw
diff --git a/src/version.c b/src/version.c
index 2f05cea..9b20fb7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1431,
+/**/
1430,
/**/
1429,