1
0
forked from aniani/vim

patch 8.1.1431: popup window listed as "Scratch"

Problem:    Popup window listed as "Scratch".
Solution:   List them as "Popup".
This commit is contained in:
Bram Moolenaar
2019-05-30 22:32:34 +02:00
parent 402502d0e4
commit c6896e20f8
6 changed files with 24 additions and 5 deletions

View File

@@ -5781,6 +5781,10 @@ buf_spname(buf_T *buf)
#ifdef FEAT_JOB_CHANNEL
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]");
}

View File

@@ -550,6 +550,7 @@ f_popup_hide(typval_T *argvars, typval_T *rettv UNUSED)
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 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
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);
}
}

View File

@@ -196,12 +196,16 @@ func Test_popup_hide()
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

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1431,
/**/
1430,
/**/