comparison runtime/doc/popup.txt @ 17075:dacd46fbaa90 v8.1.1537

patch 8.1.1537: using "tab" for popup window can be confusing commit https://github.com/vim/vim/commit/fc06cbbf8601a453b4a62a17558821add09f863f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 15 14:14:31 2019 +0200 patch 8.1.1537: using "tab" for popup window can be confusing Problem: Using "tab" for popup window can be confusing. Solution: Use "tabpage". (Hirohito Higashi, closes https://github.com/vim/vim/issues/4532)
author Bram Moolenaar <Bram@vim.org>
date Sat, 15 Jun 2019 14:15:06 +0200
parents 221d4b82bc0b
children 2546930657a9
comparison
equal deleted inserted replaced
17074:a86c4ae3192a 17075:dacd46fbaa90
38 38
39 'hlsearch' highlighting is not displayed in a popup window. 39 'hlsearch' highlighting is not displayed in a popup window.
40 40
41 A popup window has a window-ID like other windows, but behaves differently. 41 A popup window has a window-ID like other windows, but behaves differently.
42 The size can be up to the whole Vim window and it overlaps other windows. 42 The size can be up to the whole Vim window and it overlaps other windows.
43 Popup windows can also overlap each other. 43 Popup windows can also overlap each other. The "zindex" property specifies
44 what goes on top of what.
44 45
45 The popup window contains a buffer, and that buffer is always associated with 46 The popup window contains a buffer, and that buffer is always associated with
46 the popup window. The window cannot be used in Normal, Visual or Insert mode, 47 the popup window. The window cannot be in Normal, Visual or Insert mode, it
47 it does not get keyboard focus. You can use functions like `setbufline()` to 48 does not get keyboard focus. You can use functions like `setbufline()` to
48 change the text in the buffer. There are more differences from how this 49 change the text in the buffer. There are more differences from how this
49 window and buffer behave compared to regular windows and buffers, see 50 window and buffer behave compared to regular windows and buffers, see
50 |popup-buffer|. 51 |popup-buffer|.
51 52
52 If this is not what you are looking for, check out other popup functionality: 53 If this is not what you are looking for, check out other popup functionality:
83 That way you can still see where it is, even though you cannot see the text 84 That way you can still see where it is, even though you cannot see the text
84 that it is in. 85 that it is in.
85 86
86 87
87 88
88 IMPLEMENTATION: 89 TODO:
89 - Why does 'nrformats' leak from the popup window buffer??? 90 - Why does 'nrformats' leak from the popup window buffer???
90 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. 91 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window.
91 Use NOT_IN_POPUP_WINDOW for more commands. 92 Use NOT_IN_POPUP_WINDOW for more commands.
92 - Add 'balloonpopup': instead of showing text, let the callback open a popup 93 - Add 'balloonpopup': instead of showing text, let the callback open a popup
93 window and return the window ID. The popup will then be closed when the 94 window and return the window ID. The popup will then be closed when the
94 mouse moves, except when it moves inside the popup. 95 mouse moves, except when it moves inside the popup.
96 - For notifications use the PopupNotification highlight group, fall back to
97 WarningMsg if it isn't defined.
95 - For the "moved" property also include mouse movement? 98 - For the "moved" property also include mouse movement?
96 - When selecting text in the popup with modeless selection, do not select
97 outside of the popup and don't select the border or padding.
98 - Add test for dragging the popup window.
99 - Make redrawing more efficient and avoid flicker: 99 - Make redrawing more efficient and avoid flicker:
100 - put popup menu also put in popup_mask? 100 - put popup menu also put in popup_mask?
101 - Invoke filter with character before mapping? 101 - Invoke filter with character before mapping?
102 - Figure out the size and position better. 102 - Figure out the size and position better.
103 if wrapping splits a double-wide character 103 if wrapping splits a double-wide character
104 if wrapping inserts indent 104 if wrapping inserts indent
105 - When drawing on top half a double-wide character, display ">" or "<" in the 105 - When drawing on top half a double-wide character, display ">" or "<" in the
106 incomplete cell. 106 incomplete cell.
107 - Can the buffer be re-used, to avoid using up lots of buffer numbers? 107 - Can the buffer be re-used, to avoid using up lots of buffer numbers?
108 - Implement all the unimplemented options and features. 108 - Implement:
109 popup_dialog({text}, {options})
110 popup_filter_menu({id}, {key})
111 popup_filter_yesno({id}, {key})
112 popup_menu({text}, {options})
113 popup_setoptions({id}, {options})
114 flip option
115 hidden option
116 tabpage option with number
117 title option
118 transparent text property
109 119
110 120
111 ============================================================================== 121 ==============================================================================
112 2. Functions *popup-functions* 122 2. Functions *popup-functions*
113 123
138 Other: 148 Other:
139 |popup_getoptions()| get current options for a popup 149 |popup_getoptions()| get current options for a popup
140 |popup_getpos()| get actual position and size of a popup 150 |popup_getpos()| get actual position and size of a popup
141 151
142 152
143 [functions to be moved to eval.txt later] 153 [functions help to be moved to eval.txt later]
144 154
145 popup_atcursor({text}, {options}) *popup_atcursor()* 155 popup_atcursor({text}, {options}) *popup_atcursor()*
146 Show the {text} above the cursor, and close it when the cursor 156 Show the {text} above the cursor, and close it when the cursor
147 moves. This works like: > 157 moves. This works like: >
148 call popup_create({text}, { 158 call popup_create({text}, {
289 This works like: > 299 This works like: >
290 call popup_create({text}, { 300 call popup_create({text}, {
291 \ 'line': 1, 301 \ 'line': 1,
292 \ 'col': 10, 302 \ 'col': 10,
293 \ 'time': 3000, 303 \ 'time': 3000,
294 \ 'tab': -1, 304 \ 'tabpage': -1,
295 \ 'zindex': 200, 305 \ 'zindex': 200,
296 \ 'drag': 1, 306 \ 'drag': 1,
297 \ 'highlight': 'WarningMsg', 307 \ 'highlight': 'WarningMsg',
298 \ 'border': [], 308 \ 'border': [],
299 \ 'padding': [0,1,0,1], 309 \ 'padding': [0,1,0,1],
400 looks like the text scrolled up. When out of range 410 looks like the text scrolled up. When out of range
401 the last buffer line will at the top of the window. 411 the last buffer line will at the top of the window.
402 hidden When TRUE the popup exists but is not displayed; use 412 hidden When TRUE the popup exists but is not displayed; use
403 `popup_show()` to unhide it. 413 `popup_show()` to unhide it.
404 {not implemented yet} 414 {not implemented yet}
405 tab When -1: display the popup on all tabs. 415 tabpage When -1: display the popup on all tabs.
406 When 0 (the default): display the popup on the current 416 When 0 (the default): display the popup on the current
407 tab. 417 tab page.
408 Otherwise the number of the tab page the popup is 418 Otherwise the number of the tab page the popup is
409 displayed on; when invalid the current tab is used. 419 displayed on; when invalid the current tab page is used.
410 {only -1 and 0 are implemented} 420 {only -1 and 0 are implemented}
411 title Text to be displayed above the first item in the 421 title Text to be displayed above the first item in the
412 popup, on top of any border. If there is no top 422 popup, on top of any border. If there is no top
413 border one line of padding is added to put the title 423 border one line of padding is added to put the title
414 on. 424 on.