Mercurial > vim
comparison runtime/doc/popup.txt @ 17107:0001d10a7661 v8.1.1553
patch 8.1.1553: not easy to change the text in a popup window
commit https://github.com/vim/vim/commit/dc2ce58b5ac72e2af765385eb426660104816344
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 16 15:32:14 2019 +0200
patch 8.1.1553: not easy to change the text in a popup window
Problem: Not easy to change the text in a popup window.
Solution: Add popup_settext(). (Ben Jackson, closes https://github.com/vim/vim/issues/4549)
Also display a space for an empty popup.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Jun 2019 15:45:05 +0200 |
parents | 94007c802045 |
children | 7ef5283ace3c |
comparison
equal
deleted
inserted
replaced
17106:32af152d94b1 | 17107:0001d10a7661 |
---|---|
102 if wrapping inserts indent | 102 if wrapping inserts indent |
103 - When drawing on top half a double-wide character, display ">" or "<" in the | 103 - When drawing on top half a double-wide character, display ">" or "<" in the |
104 incomplete cell. | 104 incomplete cell. |
105 - Can the buffer be re-used, to avoid using up lots of buffer numbers? | 105 - Can the buffer be re-used, to avoid using up lots of buffer numbers? |
106 - Use a popup window for the "info" item of completion instead of using a | 106 - Use a popup window for the "info" item of completion instead of using a |
107 preview window. | 107 preview window. Ideas in issue #4544. |
108 How to add highlighting? | |
109 - When the lines do not fit show a scrollbar (like in the popup menu). | |
110 Use the mouse wheel for scrolling. | |
108 - Implement: | 111 - Implement: |
109 popup_filter_menu({id}, {key}) | 112 popup_filter_menu({id}, {key}) |
110 popup_menu({text}, {options}) | 113 popup_menu({text}, {options}) |
111 popup_setoptions({id}, {options}) | 114 popup_setoptions({id}, {options}) |
112 flip option | |
113 hidden option | 115 hidden option |
114 tabpage option with number | 116 tabpage option with number |
115 title option | 117 title option |
118 flip option | |
116 transparent text property | 119 transparent text property |
117 | 120 |
118 | 121 |
119 ============================================================================== | 122 ============================================================================== |
120 2. Functions *popup-functions* | 123 2. Functions *popup-functions* |
132 Manipulating a popup window: | 135 Manipulating a popup window: |
133 |popup_hide()| hide a popup temporarily | 136 |popup_hide()| hide a popup temporarily |
134 |popup_show()| show a previously hidden popup | 137 |popup_show()| show a previously hidden popup |
135 |popup_move()| change the position and size of a popup | 138 |popup_move()| change the position and size of a popup |
136 |popup_setoptions()| override options of a popup | 139 |popup_setoptions()| override options of a popup |
140 |popup_settext()| replace the popup buffer contents | |
137 | 141 |
138 Closing popup windows: | 142 Closing popup windows: |
139 |popup_close()| close one popup | 143 |popup_close()| close one popup |
140 |popup_clear()| close all popups | 144 |popup_clear()| close all popups |
141 | 145 |
328 | 332 |
329 popup_setoptions({id}, {options}) *popup_setoptions()* | 333 popup_setoptions({id}, {options}) *popup_setoptions()* |
330 {not implemented yet} | 334 {not implemented yet} |
331 Override options in popup {id} with entries in {options}. | 335 Override options in popup {id} with entries in {options}. |
332 | 336 |
337 popup_settext({id}, {text}) *popup_settext()* | |
338 Set the text of the buffer in poup win {id}. {text} is the | |
339 same as supplied to |popup_create()|. | |
340 Does not change the window size or position, other than caused | |
341 by the different text. | |
333 | 342 |
334 | 343 |
335 POPUP BUFFER AND WINDOW *popup-buffer* | 344 POPUP BUFFER AND WINDOW *popup-buffer* |
336 | 345 |
337 A new buffer is created to hold the text and text properties of the popup | 346 A new buffer is created to hold the text and text properties of the popup |
363 need them. | 372 need them. |
364 | 373 |
365 | 374 |
366 POPUP_CREATE() ARGUMENTS *popup_create-usage* | 375 POPUP_CREATE() ARGUMENTS *popup_create-usage* |
367 | 376 |
368 The first argument of |popup_create()| specifies the text to be displayed, and | 377 The first argument of |popup_create()| (and the second argument to |
369 optionally text properties. It is in one of three forms: | 378 |popup_setttext()|) specifies the text to be displayed, and optionally text |
379 properties. It is in one of three forms: | |
370 - a string | 380 - a string |
371 - a list of strings | 381 - a list of strings |
372 - a list of dictionaries, where each dictionary has these entries: | 382 - a list of dictionaries, where each dictionary has these entries: |
373 text String with the text to display. | 383 text String with the text to display. |
374 props A list of text properties. Optional. | 384 props A list of text properties. Optional. |
402 the popup is moved to the left so as to fit the | 412 the popup is moved to the left so as to fit the |
403 contents on the screen. Set to TRUE to disable this. | 413 contents on the screen. Set to TRUE to disable this. |
404 flip When TRUE (the default) and the position is relative | 414 flip When TRUE (the default) and the position is relative |
405 to the cursor, flip to below or above the cursor to | 415 to the cursor, flip to below or above the cursor to |
406 avoid overlap with the |popupmenu-completion| or | 416 avoid overlap with the |popupmenu-completion| or |
407 another popup with a higher "zindex". | 417 another popup with a higher "zindex". When there is |
418 no space above/below the cursor then show the popup to | |
419 the side of the popup or popup menu. | |
408 {not implemented yet} | 420 {not implemented yet} |
409 maxheight Maximum height of the contents, excluding border and | 421 maxheight Maximum height of the contents, excluding border and |
410 padding. | 422 padding. |
411 minheight Minimum height of the contents, excluding border and | 423 minheight Minimum height of the contents, excluding border and |
412 padding. | 424 padding. |
432 on. | 444 on. |
433 {not implemented yet} | 445 {not implemented yet} |
434 wrap TRUE to make the lines wrap (default TRUE). | 446 wrap TRUE to make the lines wrap (default TRUE). |
435 drag TRUE to allow the popup to be dragged with the mouse | 447 drag TRUE to allow the popup to be dragged with the mouse |
436 by grabbing at at the border. Has no effect if the | 448 by grabbing at at the border. Has no effect if the |
437 popup does not have a border. | 449 popup does not have a border. As soon as dragging |
450 starts and "pos" is "center" it is changed to | |
451 "topleft". | |
438 highlight Highlight group name to use for the text, stored in | 452 highlight Highlight group name to use for the text, stored in |
439 the 'wincolor' option. | 453 the 'wincolor' option. |
440 padding List with numbers, defining the padding | 454 padding List with numbers, defining the padding |
441 above/right/below/left of the popup (similar to CSS). | 455 above/right/below/left of the popup (similar to CSS). |
442 An empty list uses a padding of 1 all around. The | 456 An empty list uses a padding of 1 all around. The |