Problem: Popup window listed as "Scratch".
Solution: List them as "Popup".
IMPLEMENTATION:
- Code is in popupwin.c
-- Implement the "pos" option.
- Implement filter.
Check that popup_close() works in the filter.
+- Implement padding
+- Implement border
- Handle screen resize in screenalloc().
-- show [Popup] instead of [Scratch] in ":ls!"
- Make redrawing more efficient and avoid flicker.
Store popup info in a mask, use the mask in screen_line()
Fix redrawing problem with completion.
call setwinvar(winid, '&wrap', 0)
And options can be set on the buffer with `setbufvar()`, e.g.: >
call setbufvar(winbufnr(winid), '&filetype', 'java')
+Note that this does not trigger autocommands. Use `win_execute()` if you do
+need them.
POPUP_CREATE() ARGUMENTS *popup_create-usage*
Alternatively "center" can be used to position the
popup in the center of the Vim window, in which case
"line" and "col" are ignored.
- {not implemented yet}
flip when TRUE (the default) and the position is relative
to the cursor, flip to below or above the cursor to
avoid overlap with the |popupmenu-completion| or
popup, on top of any border
{not implemented yet}
wrap TRUE to make the lines wrap (default TRUE)
- {not implemented yet}
highlight highlight group name to use for the text, stored in
the 'wincolor' option
padding list with numbers, defining the padding
-*windows.txt* For Vim version 8.1. Last change: 2019 May 18
+*windows.txt* For Vim version 8.1. Last change: 2019 May 30
VIM REFERENCE MANUAL by Bram Moolenaar
thus you can always go to a specific buffer with ":buffer N"
or "N CTRL-^", where N is the buffer number.
+ For the file name these special values are used:
+ [Prompt] |prompt-buffer|
+ [Popup] buffer of a |popup-window|
+ [Scratch] 'buftype' is "nofile"
+ [No Name] no file name specified
+ For a |terminal-window| buffer the status is used.
+
Indicators (chars in the same column are mutually exclusive):
u an unlisted buffer (only displayed when [!] is used)
|unlisted-buffer|
#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]");
}
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);
}
}
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);
}
}
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1431,
/**/
1430,
/**/