comparison runtime/doc/popup.txt @ 16871:e5dab34ded73

Update runtime files. commit https://github.com/vim/vim/commit/7dd64a3e57d296fdee3b3ffe6d938f634b59848c Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 31 21:41:05 2019 +0200 Update runtime files.
author Bram Moolenaar <Bram@vim.org>
date Fri, 31 May 2019 21:45:06 +0200
parents 0154363d3b98
children 998603a243d7
comparison
equal deleted inserted replaced
16870:326aed2be220 16871:e5dab34ded73
1 *popup.txt* For Vim version 8.1. Last change: 2019 May 26 1 *popup.txt* For Vim version 8.1. Last change: 2019 May 31
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
11 1. Introduction |popup-intro| 11 1. Introduction |popup-intro|
12 2. Functions |popup-functions| 12 2. Functions |popup-functions|
13 3. Examples |popup-examples| 13 3. Examples |popup-examples|
14 14
15 15
16 {not available if the |+eval| feature was disabled at compile time} 16 {not available if the |+textprop| feature was disabled at compile time}
17 {not able to use text properties if the |+textprop| feature was disabled at
18 compile time}
19 17
20 ============================================================================== 18 ==============================================================================
21 1. Introduction *popup-intro* 19 1. Introduction *popup-intro*
22 20
23 We are talking about popup windows here, text that goes on top of the regular 21 We are talking about popup windows here, text that goes on top of the regular
58 56
59 WINDOW POSITION AND SIZE *popup-position* 57 WINDOW POSITION AND SIZE *popup-position*
60 58
61 The height of the window is normally equal to the number of, possibly 59 The height of the window is normally equal to the number of, possibly
62 wrapping, lines in the buffer. It can be limited with the "maxheight" 60 wrapping, lines in the buffer. It can be limited with the "maxheight"
63 property. You can use empty lines to increase the height. 61 property. You can use empty lines to increase the height or the "minheight"
62 property.
64 63
65 The width of the window is normally equal to the longest line in the buffer. 64 The width of the window is normally equal to the longest line in the buffer.
66 It can be limited with the "maxwidth" property. You can use spaces to 65 It can be limited with the "maxwidth" property. You can use spaces to
67 increase the width. 66 increase the width or the "minwidth" property.
68 67
69 By default the 'wrap' option is set, so that no text disappears. However, if 68 By default the 'wrap' option is set, so that no text disappears. However, if
70 there is not enough space, some text may be invisible. 69 there is not enough space, some text may be invisible.
70
71 Vim tries to show the popup in the location you specify. In some cases, e.g.
72 when the popup would go outside of the Vim window, it will show it somewhere
73 else. E.g. if you use `popup_atcursor()` the popup normally shows just above
74 the current cursor position, but if the cursor is close to the top of the Vim
75 window it will be placed below the cursor position.
71 76
72 77
73 78
74 TODO: 79 TODO:
75 80
90 - Implement padding 95 - Implement padding
91 - Implement border 96 - Implement border
92 - Handle screen resize in screenalloc(). 97 - Handle screen resize in screenalloc().
93 - Make redrawing more efficient and avoid flicker. 98 - Make redrawing more efficient and avoid flicker.
94 Store popup info in a mask, use the mask in screen_line() 99 Store popup info in a mask, use the mask in screen_line()
100 Keep mask until next update_screen(), find differences and redraw affected
101 windows/lines
95 Fix redrawing problem with completion. 102 Fix redrawing problem with completion.
96 Fix redrawing problem when scrolling non-current window 103 Fix redrawing problem when scrolling non-current window
97 Fix redrawing the statusline on top of a popup 104 Fix redrawing the statusline on top of a popup
105 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. Or whitelist
106 commands that are allowed?
98 - Figure out the size and position better. 107 - Figure out the size and position better.
99 if wrapping splits a double-wide character 108 if wrapping splits a double-wide character
100 if wrapping inserts indent 109 if wrapping inserts indent
101 - Can the buffer be re-used, to avoid using up lots of buffer numbers? 110 - Can the buffer be re-used, to avoid using up lots of buffer numbers?
102 - Implement all the unimplemented options and features. 111 - Implement all the unimplemented options and features.
112 popup_create({text}, {options}) *popup_create()* 121 popup_create({text}, {options}) *popup_create()*
113 Open a popup window showing {text}, which is either: 122 Open a popup window showing {text}, which is either:
114 - a string 123 - a string
115 - a list of strings 124 - a list of strings
116 - a list of text lines with text properties 125 - a list of text lines with text properties
117 {not implemented yet} 126
118 {options} is a dictionary with many possible entries. 127 {options} is a dictionary with many possible entries.
119 See |popup_create-usage| for details. 128 See |popup_create-usage| for details.
120 129
121 Returns a window-ID, which can be used with other popup 130 Returns a window-ID, which can be used with other popup
122 functions. Use `winbufnr()` to get the number of the buffer 131 functions. Use `winbufnr()` to get the number of the buffer
408 id user defined ID for the property; when omitted zero is 417 id user defined ID for the property; when omitted zero is
409 used 418 used
410 type name of the text property type, as added with 419 type name of the text property type, as added with
411 |prop_type_add()| 420 |prop_type_add()|
412 transparent do not show these characters, show the text under it; 421 transparent do not show these characters, show the text under it;
413 if there is an border character to the right or below 422 if there is a border character to the right or below
414 it will be made transparent as well 423 it will be made transparent as well
415 {not implemented yet} 424 {not implemented yet}
416 425
417 426
418 POPUP FILTER *popup-filter* 427 POPUP FILTER *popup-filter*