Mercurial > vim
annotate runtime/doc/popup.txt @ 17129:4fb68abc770f v8.1.1564
patch 8.1.1564: sign column takes up space
commit https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 17 21:48:05 2019 +0200
patch 8.1.1564: sign column takes up space
Problem: Sign column takes up space. (Adam Stankiewicz)
Solution: Optionally put signs in the number column. (Yegappan Lakshmanan,
closes #4555, closes #4515)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 17 Jun 2019 22:00:09 +0200 |
parents | efc6f5e3b543 |
children | c90fdb999393 |
rev | line source |
---|---|
17077
2546930657a9
patch 8.1.1538: cannot specify highlighting for notifications
Bram Moolenaar <Bram@vim.org>
parents:
17075
diff
changeset
|
1 *popup.txt* For Vim version 8.1. Last change: 2019 Jun 15 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 VIM REFERENCE MANUAL by Bram Moolenaar |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
7 Displaying text in floating window. *popup* *popup-window* |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 |
17036 | 9 THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 1. Introduction |popup-intro| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 2. Functions |popup-functions| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 3. Examples |popup-examples| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 |
16871 | 16 {not available if the |+textprop| feature was disabled at compile time} |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 ============================================================================== |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 1. Introduction *popup-intro* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
21 We are talking about popup windows here, text that goes on top of the regular |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
22 windows and is under control of a plugin. You cannot edit the text in the |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
23 popup window like with regular windows. |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
24 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
25 A popup window can be used for such things as: |
16808 | 26 - briefly show a message without overwriting the command line |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
27 - prompt the user with a dialog |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
28 - display contextual information while typing |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
29 - give extra information for auto-completion |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
30 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
31 The text in the popup window can be colored with |text-properties|. It is |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
32 also possible to use syntax highlighting. |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
33 |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
34 The default color used is "Pmenu". If you prefer something else use the |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
35 "highlight" argument or the 'wincolor' option, e.g.: > |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
36 hi MyPopupColor ctermbg=lightblue guibg=lightblue |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
37 call setwinvar(winid, '&wincolor', 'MyPopupColor') |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
38 |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
39 'hlsearch' highlighting is not displayed in a popup window. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
40 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
41 A popup window has a window-ID like other windows, but behaves differently. |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
42 The size can be up to the whole Vim window and it overlaps other windows. |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
43 Popup windows can also overlap each other. The "zindex" property specifies |
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
44 what goes on top of what. |
16808 | 45 |
46 The popup window contains a buffer, and that buffer is always associated with | |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
47 the popup window. The window cannot be in Normal, Visual or Insert mode, it |
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
48 does not get keyboard focus. You can use functions like `setbufline()` to |
16808 | 49 change the text in the buffer. There are more differences from how this |
50 window and buffer behave compared to regular windows and buffers, see | |
51 |popup-buffer|. | |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
52 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
53 If this is not what you are looking for, check out other popup functionality: |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 - popup menu, see |popup-menu| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 - balloon, see |balloon-eval| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
57 |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
58 WINDOW POSITION AND SIZE *popup-position* |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
59 |
16808 | 60 The height of the window is normally equal to the number of, possibly |
61 wrapping, lines in the buffer. It can be limited with the "maxheight" | |
16871 | 62 property. You can use empty lines to increase the height or the "minheight" |
63 property. | |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
64 |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
65 The width of the window is normally equal to the longest line in the buffer. |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
66 It can be limited with the "maxwidth" property. You can use spaces to |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
67 increase the width or use the "minwidth" property. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
68 |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
69 By default the 'wrap' option is set, so that no text disappears. Otherwise, |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
70 if there is not enough space then the window is shifted left in order to |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
71 display more text. This can be disabled with the "fixed" property. Also |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
72 disabled when right-aligned. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
73 |
16871 | 74 Vim tries to show the popup in the location you specify. In some cases, e.g. |
75 when the popup would go outside of the Vim window, it will show it somewhere | |
76 else. E.g. if you use `popup_atcursor()` the popup normally shows just above | |
77 the current cursor position, but if the cursor is close to the top of the Vim | |
78 window it will be placed below the cursor position. | |
79 | |
17036 | 80 When the screen scrolls up for output of an Ex command, popups move too, so |
81 that they will not cover the output. | |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
82 |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
83 The current cursor position is displayed even when it is under a popup window. |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
84 That way you can still see where it is, even though you cannot see the text |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
85 that it is in. |
16833
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16829
diff
changeset
|
86 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
87 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
88 |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
89 TODO: |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
90 - Why does 'nrformats' leak from the popup window buffer??? |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
91 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
92 Use ERROR_IF_POPUP_WINDOW for more commands. |
17036 | 93 - Add 'balloonpopup': instead of showing text, let the callback open a popup |
94 window and return the window ID. The popup will then be closed when the | |
95 mouse moves, except when it moves inside the popup. | |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
96 - For the "moved" property also include mouse movement? |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
97 - Make redrawing more efficient and avoid flicker: |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
98 - put popup menu also put in popup_mask? |
16884
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
99 - Invoke filter with character before mapping? |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
100 - Figure out the size and position better. |
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
101 if wrapping splits a double-wide character |
16853
e6bcccccbf7b
patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16841
diff
changeset
|
102 if wrapping inserts indent |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
103 - When drawing on top half a double-wide character, display ">" or "<" in the |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
104 incomplete cell. |
16829
5cebaecad422
patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16817
diff
changeset
|
105 - Can the buffer be re-used, to avoid using up lots of buffer numbers? |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
106 - Use a popup window for the "info" item of completion instead of using a |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
107 preview window. Ideas in issue #4544. |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
108 How to add highlighting? |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
109 - When the lines do not fit show a scrollbar (like in the popup menu). |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
110 Use the mouse wheel for scrolling. |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
111 - Implement: |
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
112 tabpage option with number |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
113 flip option |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
114 transparent text property |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
115 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 ============================================================================== |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 2. Functions *popup-functions* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
119 |
17036 | 120 THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
122 Creating a popup window: |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
123 |popup_create()| centered in the screen |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
124 |popup_atcursor()| just above the cursor position, closes when |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
125 the cursor moves away |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
126 |popup_notifiation()| show a notification for three seconds |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
127 |popup_dialog()| centered with padding and border |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
128 |popup_menu()| prompt for selecting an item from a list |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
129 |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
130 Manipulating a popup window: |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
131 |popup_hide()| hide a popup temporarily |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
132 |popup_show()| show a previously hidden popup |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
133 |popup_move()| change the position and size of a popup |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
134 |popup_setoptions()| override options of a popup |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
135 |popup_settext()| replace the popup buffer contents |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
136 |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
137 Closing popup windows: |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
138 |popup_close()| close one popup |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
139 |popup_clear()| close all popups |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
140 |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
141 Filter functions: |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
142 |popup_filter_menu()| select from a list of items |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
143 |popup_filter_yesno()| blocks until 'y' or 'n' is pressed |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
144 |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
145 Other: |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
146 |popup_getoptions()| get current options for a popup |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
147 |popup_getpos()| get actual position and size of a popup |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
148 |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
149 |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
150 [functions help to be moved to eval.txt later] |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
152 popup_atcursor({text}, {options}) *popup_atcursor()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
153 Show the {text} above the cursor, and close it when the cursor |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
154 moves. This works like: > |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
155 call popup_create({text}, { |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
156 \ 'pos': 'botleft', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
157 \ 'line': 'cursor-1', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
158 \ 'col': 'cursor', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
159 \ 'moved': 'WORD', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
160 \ }) |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
161 < Use {options} to change the properties. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
162 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
163 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
164 *popup_clear()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
165 popup_clear() Emergency solution to a misbehaving plugin: close all popup |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
166 windows. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
167 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
168 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
169 popup_close({id} [, {result}]) *popup_close()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
170 Close popup {id}. The window and the associated buffer will |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
171 be deleted. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
172 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
173 If the popup has a callback it will be called just before the |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
174 popup window is deleted. If the optional {result} is present |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
175 it will be passed as the second argument of the callback. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
176 Otherwise zero is passed to the callback. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
177 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
178 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
179 popup_create({text}, {options}) *popup_create()* |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
180 Open a popup window showing {text}, which is either: |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
181 - a string |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
182 - a list of strings |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
183 - a list of text lines with text properties |
16871 | 184 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
185 {options} is a dictionary with many possible entries. |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
186 See |popup_create-usage| for details. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
188 Returns a window-ID, which can be used with other popup |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
189 functions. Use `winbufnr()` to get the number of the buffer |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
190 in the window: > |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
191 let winid = popup_create('hello', {}) |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
192 let bufnr = winbufnr(winid) |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
193 call setbufline(bufnr, 2, 'second line') |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
194 < In case of failure zero is returned. |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
195 |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
196 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
197 popup_dialog({text}, {options}) *popup_dialog()* |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
198 Just like |popup_create()| but with these default options: > |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
199 call popup_create({text}, { |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
200 \ 'pos': 'center', |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
201 \ 'zindex': 200, |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
202 \ 'drag': 1, |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
203 \ 'border': [], |
16890
5131023c5728
patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16888
diff
changeset
|
204 \ 'padding': [], |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
205 \}) |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
206 < Use {options} to change the properties. E.g. add a 'filter' |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
207 option with value 'popup_filter_yesno'. Example: > |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
208 call popup_create('do you want to quit (Yes/no)?', { |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
209 \ 'filter': 'popup_filter_yesno', |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
210 \ 'callback': 'QuitCallback', |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
211 \ }) |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
212 |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
213 < By default the dialog can be dragged, so that text below it |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
214 can be read if needed. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 popup_filter_menu({id}, {key}) *popup_filter_menu()* |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
218 Filter that can be used for a popup. These keys can be used: |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
219 j <Down> select item below |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
220 k <Up> select item above |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
221 <Space> <Enter> accept current selection |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
222 x Esc CTRL-C cancel the menu |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
223 Other keys are ignored. |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
224 |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
225 A match is set on that line to highlight it, see |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
226 |popup_menu()|. |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
227 |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
228 When the current selection is accepted the "callback" of the |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
229 popup menu is invoked with the index of the selected line as |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
230 the second argument. The first entry has index one. |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
231 Cancelling the menu invokes the callback with -1. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
232 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
233 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
234 popup_filter_yesno({id}, {key}) *popup_filter_yesno()* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
235 Filter that can be used for a popup. It handles only the keys |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
236 'y', 'Y' and 'n' or 'N'. Invokes the "callback" of the |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
237 popup menu with the 1 for 'y' or 'Y' and zero for 'n' or 'N' |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
238 as the second argument. Pressing Esc and 'x' works like |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
239 pressing 'n'. CTRL-C invokes the callback with -1. Other |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
240 keys are ignored. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
241 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
242 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
243 popup_getoptions({id}) *popup_getoptions()* |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
244 Return the {options} for popup {id} in a Dict. |
16855
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
245 A zero value means the option was not set. For "zindex" the |
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
246 default value is returned, not zero. |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
247 |
17123
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
248 The "moved" entry is a list with minimum and maximum column, |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
249 [0, 0] when not set. |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
250 |
17123
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
251 "border" and "padding" are not included when all values are |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
252 zero. When all values are one then an empty list is included. |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
253 |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
254 "borderhighlight" is not included when all values are empty. |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
255 |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
256 If popup window {id} is not found an empty Dict is returned. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
257 |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
258 |
16855
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
259 popup_getpos({id}) *popup_getpos()* |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
260 Return the position and size of popup {id}. Returns a Dict |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
261 with these entries: |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
262 col screen column of the popup, one-based |
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
263 line screen line of the popup, one-based |
16884
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
264 width width of the whole popup in screen cells |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
265 height height of the whole popup in screen cells |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
266 core_col screen column of the text box |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
267 core_line screen line of the text box |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
268 core_width width of the text box in screen cells |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
269 core_height height of the text box in screen cells |
17036 | 270 visible one if the popup is displayed, zero if hidden |
16829
5cebaecad422
patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16817
diff
changeset
|
271 Note that these are the actual screen positions. They differ |
5cebaecad422
patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16817
diff
changeset
|
272 from the values in `popup_getoptions()` for the sizing and |
5cebaecad422
patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16817
diff
changeset
|
273 positioning mechanism applied. |
16884
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
274 |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
275 The "core_" values exclude the padding and border. |
59e4148c0c73
patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16880
diff
changeset
|
276 |
16829
5cebaecad422
patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16817
diff
changeset
|
277 If popup window {id} is not found an empty Dict is returned. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
278 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
279 |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
280 popup_hide({id}) *popup_hide()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
281 If {id} is a displayed popup, hide it now. If the popup has a |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
282 filter it will not be invoked for so long as the popup is |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
283 hidden. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
284 If window {id} does not exist nothing happens. If window {id} |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
285 exists but is not a popup window an error is given. *E993* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
286 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
287 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
288 popup_menu({text}, {options}) *popup_menu()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
289 Show the {text} near the cursor, handle selecting one of the |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
290 items with cursorkeys, and close it an item is selected with |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
291 Space or Enter. {text} should have multiple lines to make this |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
292 useful. This works like: > |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
293 call popup_create({text}, { |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
294 \ 'pos': 'center', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
295 \ 'zindex': 200, |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
296 \ 'drag': 1, |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
297 \ 'wrap': 0, |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
298 \ 'border': [], |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
299 \ 'padding': [], |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
300 \ 'filter': 'popup_filter_menu', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
301 \ }) |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
302 < The current line is highlighted with a match using |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
303 PopupSelected, or |PmenuSel| if that is not defined. |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
304 |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
305 Use {options} to change the properties. Should at least set |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
306 "callback" to a function that handles the selected item. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
307 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
308 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
309 popup_move({id}, {options}) *popup_move()* |
17051
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
310 Move popup {id} to the position specified with {options}. |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
311 {options} may contain the items from |popup_create()| that |
17123
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
312 specify the popup position: |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
313 line |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
314 col |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
315 pos |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
316 maxheight |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
317 minheight |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
318 maxwidth |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
319 minwidth |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
320 fixed |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
321 For {id} see `popup_hide()`. |
17123
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
322 For other options see |popup_setoptions()|. |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
323 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
324 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
325 popup_notification({text}, {options}) *popup_notification()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
326 Show the {text} for 3 seconds at the top of the Vim window. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
327 This works like: > |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
328 call popup_create({text}, { |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
329 \ 'line': 1, |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
330 \ 'col': 10, |
17077
2546930657a9
patch 8.1.1538: cannot specify highlighting for notifications
Bram Moolenaar <Bram@vim.org>
parents:
17075
diff
changeset
|
331 \ 'minwidth': 20, |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
332 \ 'time': 3000, |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
333 \ 'tabpage': -1, |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
334 \ 'zindex': 300, |
17051
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
335 \ 'drag': 1, |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
336 \ 'highlight': 'WarningMsg', |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
337 \ 'border': [], |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
338 \ 'padding': [0,1,0,1], |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
339 \ }) |
17077
2546930657a9
patch 8.1.1538: cannot specify highlighting for notifications
Bram Moolenaar <Bram@vim.org>
parents:
17075
diff
changeset
|
340 < The PopupNotification highlight group is used instead of |
2546930657a9
patch 8.1.1538: cannot specify highlighting for notifications
Bram Moolenaar <Bram@vim.org>
parents:
17075
diff
changeset
|
341 WarningMsg if it is defined. |
17117
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
342 |
7ef5283ace3c
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17107
diff
changeset
|
343 The position will be adjusted to avoid overlap with other |
17045
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
344 notifications. |
7fe328ad5573
patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17036
diff
changeset
|
345 Use {options} to change the properties. |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
346 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
347 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
348 popup_show({id}) *popup_show()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
349 If {id} is a hidden popup, show it now. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
350 For {id} see `popup_hide()`. |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
351 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
352 |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
353 popup_setoptions({id}, {options}) *popup_setoptions()* |
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
354 Override options in popup {id} with entries in {options}. |
17123
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
355 These options can be set: |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
356 flip |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
357 firstline |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
358 title |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
359 wrap |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
360 drag |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
361 highlight |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
362 padding |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
363 border |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
364 borderhighlight |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
365 borderchars |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
366 zindex |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
367 time |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
368 moved |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
369 filter |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
370 callback |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
371 The options from |popup_move()| can also be used. |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
372 For "hidden" use |popup_hide()| and |popup_show()|. |
efc6f5e3b543
patch 8.1.1561: popup_setoptions() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17119
diff
changeset
|
373 "tabpage" cannot be changed. |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
374 |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
375 popup_settext({id}, {text}) *popup_settext()* |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
376 Set the text of the buffer in poup win {id}. {text} is the |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
377 same as supplied to |popup_create()|. |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
378 Does not change the window size or position, other than caused |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
379 by the different text. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
380 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
381 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
382 POPUP BUFFER AND WINDOW *popup-buffer* |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
383 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
384 A new buffer is created to hold the text and text properties of the popup |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
385 window. The buffer is always associated with the popup window and |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
386 manipulation is restricted: |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
387 - the buffer has no name |
17036 | 388 - 'buftype' is "popup" |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
389 - 'swapfile' is off |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
390 - 'bufhidden' is "hide" |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
391 - 'buflisted' is off |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
392 - 'undolevels' is -1: no undo at all |
16853
e6bcccccbf7b
patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16841
diff
changeset
|
393 - all other buffer-local and window_local options are set to their Vim default |
e6bcccccbf7b
patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16841
diff
changeset
|
394 value. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
395 |
16853
e6bcccccbf7b
patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16841
diff
changeset
|
396 It is possible to change the specifically mentioned options, but anything |
e6bcccccbf7b
patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16841
diff
changeset
|
397 might break then, so better leave them alone. |
16808 | 398 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
399 The window does have a cursor position, but the cursor is not displayed. |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
400 |
16833
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16829
diff
changeset
|
401 To execute a command in the context of the popup window and buffer use |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16829
diff
changeset
|
402 `win_execute()`. Example: > |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16829
diff
changeset
|
403 call win_execute(winid, 'syntax enable') |
6699c03347d2
patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16829
diff
changeset
|
404 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
405 Options can be set on the window with `setwinvar()`, e.g.: > |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
406 call setwinvar(winid, '&wrap', 0) |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
407 And options can be set on the buffer with `setbufvar()`, e.g.: > |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
408 call setbufvar(winbufnr(winid), '&filetype', 'java') |
16859
0154363d3b98
patch 8.1.1431: popup window listed as "Scratch"
Bram Moolenaar <Bram@vim.org>
parents:
16855
diff
changeset
|
409 Note that this does not trigger autocommands. Use `win_execute()` if you do |
0154363d3b98
patch 8.1.1431: popup window listed as "Scratch"
Bram Moolenaar <Bram@vim.org>
parents:
16855
diff
changeset
|
410 need them. |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
411 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
412 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
413 POPUP_CREATE() ARGUMENTS *popup_create-usage* |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
414 |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
415 The first argument of |popup_create()| (and the second argument to |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
416 |popup_setttext()|) specifies the text to be displayed, and optionally text |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
417 properties. It is in one of three forms: |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
418 - a string |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
419 - a list of strings |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
420 - a list of dictionaries, where each dictionary has these entries: |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
421 text String with the text to display. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
422 props A list of text properties. Optional. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
423 Each entry is a dictionary, like the third argument of |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
424 |prop_add()|, but specifying the column in the |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
425 dictionary with a "col" entry, see below: |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
426 |popup-props|. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
427 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
428 The second argument of |popup_create()| is a dictionary with options: |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
429 line Screen line where to position the popup. Can use a |
16855
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
430 number or "cursor", "cursor+1" or "cursor-1" to use |
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
431 the line of the cursor and add or subtract a number of |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
432 lines. If omitted the popup is vertically centered. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
433 The first line is 1. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
434 col Screen column where to position the popup. Can use a |
16855
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
435 number or "cursor" to use the column of the cursor, |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
436 "cursor+9" or "cursor-9" to add or subtract a number |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
437 of columns. If omitted the popup is horizontally |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
438 centered. The first column is 1. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
439 pos "topleft", "topright", "botleft" or "botright": |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
440 defines what corner of the popup "line" and "col" are |
16841
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
441 used for. When not set "topleft" is used. |
cf630fab9fb6
patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16833
diff
changeset
|
442 Alternatively "center" can be used to position the |
16855
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
443 popup in the center of the Vim window, in which case |
19162ff4eacd
patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents:
16853
diff
changeset
|
444 "line" and "col" are ignored. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
445 fixed When FALSE (the default), and: |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
446 - "pos" is "botleft" or "topleft", and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
447 - "wrap" is off, and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
448 - the popup would be truncated at the right edge of |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
449 the screen, then |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
450 the popup is moved to the left so as to fit the |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
451 contents on the screen. Set to TRUE to disable this. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
452 flip When TRUE (the default) and the position is relative |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
453 to the cursor, flip to below or above the cursor to |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
454 avoid overlap with the |popupmenu-completion| or |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
455 another popup with a higher "zindex". When there is |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
456 no space above/below the cursor then show the popup to |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
457 the side of the popup or popup menu. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
458 {not implemented yet} |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
459 maxheight Maximum height of the contents, excluding border and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
460 padding. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
461 minheight Minimum height of the contents, excluding border and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
462 padding. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
463 maxwidth Maximum width of the contents, excluding border and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
464 padding. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
465 minwidth Minimum width of the contents, excluding border and |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
466 padding. |
17047
6400d1ad5e4b
patch 8.1.1523: cannot show range of buffer lines in popup window
Bram Moolenaar <Bram@vim.org>
parents:
17045
diff
changeset
|
467 firstline First buffer line to display. When larger than one it |
6400d1ad5e4b
patch 8.1.1523: cannot show range of buffer lines in popup window
Bram Moolenaar <Bram@vim.org>
parents:
17045
diff
changeset
|
468 looks like the text scrolled up. When out of range |
6400d1ad5e4b
patch 8.1.1523: cannot show range of buffer lines in popup window
Bram Moolenaar <Bram@vim.org>
parents:
17045
diff
changeset
|
469 the last buffer line will at the top of the window. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
470 hidden When TRUE the popup exists but is not displayed; use |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
471 `popup_show()` to unhide it. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
472 {not implemented yet} |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
473 tabpage When -1: display the popup on all tabs. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
474 When 0 (the default): display the popup on the current |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
475 tab page. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
476 Otherwise the number of the tab page the popup is |
17075
dacd46fbaa90
patch 8.1.1537: using "tab" for popup window can be confusing
Bram Moolenaar <Bram@vim.org>
parents:
17051
diff
changeset
|
477 displayed on; when invalid the current tab page is used. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
478 {only -1 and 0 are implemented} |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
479 title Text to be displayed above the first item in the |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
480 popup, on top of any border. If there is no top |
17051
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
481 border one line of padding is added to put the title |
17119
b439e096a011
patch 8.1.1559: popup window title property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17117
diff
changeset
|
482 on. You might want to add one or more spaces at the |
b439e096a011
patch 8.1.1559: popup window title property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
17117
diff
changeset
|
483 start and end as padding. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
484 wrap TRUE to make the lines wrap (default TRUE). |
17051
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
485 drag TRUE to allow the popup to be dragged with the mouse |
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
486 by grabbing at at the border. Has no effect if the |
17107
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
487 popup does not have a border. As soon as dragging |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
488 starts and "pos" is "center" it is changed to |
0001d10a7661
patch 8.1.1553: not easy to change the text in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
17097
diff
changeset
|
489 "topleft". |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
490 highlight Highlight group name to use for the text, stored in |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
491 the 'wincolor' option. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
492 padding List with numbers, defining the padding |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
493 above/right/below/left of the popup (similar to CSS). |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
494 An empty list uses a padding of 1 all around. The |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
495 padding goes around the text, inside any border. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
496 Padding uses the 'wincolor' highlight. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
497 Example: [1, 2, 1, 3] has 1 line of padding above, 2 |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
498 columns on the right, 1 line below and 3 columns on |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
499 the left. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
500 border List with numbers, defining the border thickness |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
501 above/right/below/left of the popup (similar to CSS). |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
502 Only values of zero and non-zero are recognized. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
503 An empty list uses a border all around. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
504 borderhighlight List of highlight group names to use for the border. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
505 When one entry it is used for all borders, otherwise |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
506 the highlight for the top/right/bottom/left border. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
507 Example: ['TopColor', 'RightColor', 'BottomColor, |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
508 'LeftColor'] |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
509 borderchars List with characters, defining the character to use |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
510 for the top/right/bottom/left border. Optionally |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
511 followed by the character to use for the |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
512 topleft/topright/botright/botleft corner. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
513 Example: ['-', '|', '-', '|', '┌', '┐', '┘', '└'] |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
514 When the list has one character it is used for all. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
515 When the list has two characters the first is used for |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
516 the border lines, the second for the corners. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
517 By default a double line is used all around when |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
518 'encoding' is "utf-8", otherwise ASCII characters are |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
519 used. |
17051
221d4b82bc0b
patch 8.1.1525: cannot move a popup window with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
17047
diff
changeset
|
520 zindex Priority for the popup, default 50. Minimum value is |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
521 1, maximum value is 32000. |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
522 time Time in milliseconds after which the popup will close. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
523 When omitted |popup_close()| must be used. |
16904
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
524 moved Specifies to close the popup if the cursor moved: |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
525 - "any": if the cursor moved at all |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
526 - "word": if the cursor moved outside |<cword>| |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
527 - "WORD": if the cursor moved outside |<cWORD>| |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
528 - [{start}, {end}]: if the cursor moved before column |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
529 {start} or after {end} |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
530 The popup also closes if the cursor moves to another |
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
531 line or to another window. |
17036 | 532 filter A callback that can filter typed characters, see |
16896
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
533 |popup-filter|. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
534 callback A callback that is called when the popup closes, e.g. |
52fc577a087d
patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents:
16890
diff
changeset
|
535 when using |popup_filter_menu()|, see |popup-callback|. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
536 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
537 Depending on the "zindex" the popup goes under or above other popups. The |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
538 completion menu (|popup-menu|) has zindex 100. For messages that occur for a |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
539 short time the suggestion is to use zindex 1000. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
540 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
541 By default text wraps, which causes a line in {lines} to occupy more than one |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
542 screen line. When "wrap" is FALSE then the text outside of the popup or |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
543 outside of the Vim window will not be displayed, thus truncated. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
544 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
545 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
546 POPUP TEXT PROPERTIES *popup-props* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
547 |
16811
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
548 These are similar to the third argument of |prop_add()| except: |
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
549 - "lnum" is always the current line in the list |
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
550 - "bufnr" is always the buffer of the popup |
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
551 - "col" is in the Dict instead of a separate argument |
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
552 - "transparent" is extra |
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
553 So we get: |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
554 col starting column, counted in bytes, use one for the |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
555 first column. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
556 length length of text in bytes; can be zero |
16811
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
557 end_lnum line number for the end of the text |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
558 end_col column just after the text; not used when "length" is |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
559 present; when {col} and "end_col" are equal, this is a |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
560 zero-width text property |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
561 id user defined ID for the property; when omitted zero is |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
562 used |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
563 type name of the text property type, as added with |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
564 |prop_type_add()| |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
565 transparent do not show these characters, show the text under it; |
16871 | 566 if there is a border character to the right or below |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
567 it will be made transparent as well |
16811
0457d49eb2d9
patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents:
16809
diff
changeset
|
568 {not implemented yet} |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
569 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
570 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
571 POPUP FILTER *popup-filter* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
572 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
573 A callback that gets any typed keys while a popup is displayed. The filter is |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
574 not invoked when the popup is hidden. |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
575 |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
576 The filter can return TRUE to indicate the key has been handled and is to be |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
577 discarded, or FALSE to let Vim handle the key as usual in the current state. |
16778
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
578 In case it returns FALSE and there is another popup window visible, that |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
579 filter is also called. The filter of the popup window with the highest zindex |
eda4d65f232c
patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents:
16724
diff
changeset
|
580 is called first. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
581 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
582 The filter function is called with two arguments: the ID of the popup and the |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
583 key as a string, e.g.: > |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
584 func MyFilter(winid, key) |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
585 if a:key == "\<F2>" |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
586 " do something |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
587 return 1 |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
588 endif |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
589 if a:key == 'x' |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
590 call popup_close(a:winid) |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
591 return 1 |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
592 endif |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
593 return 0 |
17036 | 594 endfunc |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
595 |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
596 Currently the key is what results after any mapping. This may change... |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
597 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
598 Some common key actions: |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
599 x close the popup (see note below) |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
600 cursor keys select another entry |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
601 Tab accept current suggestion |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
602 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
603 A mouse click arrives as <LeftMouse>. The coordinates are in |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
604 v:mouse_popup_col and v:mouse_popup_row. The top-left screen cell of the |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
605 popup is col 1, row 1 (not counting the border). |
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
606 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
607 Vim provides standard filters |popup_filter_menu()| and |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
608 |popup_filter_yesno()|. |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
609 |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
610 Note that "x" is the normal way to close a popup. You may want to use Esc, |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
611 but since many keys start with an Esc character, there may be a delay before |
17026
905e1b154058
patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents:
16944
diff
changeset
|
612 Vim recognizes the Esc key. If you do use Esc, it is recommended to set the |
16880
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
613 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'. |
998603a243d7
patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents:
16871
diff
changeset
|
614 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
615 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
616 POPUP CALLBACK *popup-callback* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
617 |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
618 A callback that is invoked when the popup closes. |
16890
5131023c5728
patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16888
diff
changeset
|
619 |
5131023c5728
patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16888
diff
changeset
|
620 The callback is invoked with two arguments: the ID of the popup window and the |
5131023c5728
patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16888
diff
changeset
|
621 result, which could be an index in the popup lines, or whatever was passed as |
5131023c5728
patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16888
diff
changeset
|
622 the second argument of `popup_close()`. |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
623 |
17097
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
624 If the popup is force-closed, e.g. because the cursor moved or CTRL-C was |
94007c802045
patch 8.1.1548: popup_dialog() is not implemented
Bram Moolenaar <Bram@vim.org>
parents:
17077
diff
changeset
|
625 pressed, the number -1 is passed to the callback. |
16904
9138e2c60bf1
patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
16896
diff
changeset
|
626 |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
627 ============================================================================== |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
628 3. Examples *popup-examples* |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
629 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
630 TODO |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
631 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
632 Prompt the user to press y/Y or n/N: > |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
633 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
634 func MyDialogHandler(id, result) |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
635 if a:result |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
636 " ... 'y' or 'Y' was pressed |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
637 endif |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
638 endfunc |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
639 |
16724
6030631a1541
patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents:
16654
diff
changeset
|
640 call popup_create(['Continue? y/n'], { |
16654
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
641 \ 'filter': 'popup_filter_yesno', |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
642 \ 'callback': 'MyDialogHandler', |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
643 \ }) |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
644 < |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
645 |
7d54a66c95d7
patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
646 vim:tw=78:ts=8:noet:ft=help:norl: |