annotate runtime/doc/popup.txt @ 17047:6400d1ad5e4b v8.1.1523

patch 8.1.1523: cannot show range of buffer lines in popup window commit https://github.com/vim/vim/commit/8d241040310a6a27c28d62fa04558f2bfaa5ebde Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 12 23:40:01 2019 +0200 patch 8.1.1523: cannot show range of buffer lines in popup window Problem: Cannot show range of buffer lines in popup window. Solution: Add the "firstline" property. (closes https://github.com/vim/vim/issues/4523)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jun 2019 23:45:04 +0200
parents 7fe328ad5573
children 221d4b82bc0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
1 *popup.txt* For Vim version 8.1. Last change: 2019 Jun 12
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
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
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
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
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
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
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.
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
43 Popup windows can also overlap each other.
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
44
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
45 The popup window contains a buffer, and that buffer is always associated with
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
46 the popup window. The window cannot be used in Normal, Visual or Insert mode,
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
47 it does not get keyboard focus. You can use functions like `setbufline()` to
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
48 change the text in the buffer. There are more differences from how this
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
49 window and buffer behave compared to regular windows and buffers, see
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
50 |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
51
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
52 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
53 - 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
54 - 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
55
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
56
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
57 WINDOW POSITION AND SIZE *popup-position*
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
58
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
59 The height of the window is normally equal to the number of, possibly
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
60 wrapping, lines in the buffer. It can be limited with the "maxheight"
16871
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
61 property. You can use empty lines to increase the height or the "minheight"
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
62 property.
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
63
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
64 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
65 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
66 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
67
16896
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
68 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
69 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
70 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
71 disabled when right-aligned.
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
72
16871
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
73 Vim tries to show the popup in the location you specify. In some cases, e.g.
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
74 when the popup would go outside of the Vim window, it will show it somewhere
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
75 else. E.g. if you use `popup_atcursor()` the popup normally shows just above
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
76 the current cursor position, but if the cursor is close to the top of the Vim
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
77 window it will be placed below the cursor position.
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
78
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
79 When the screen scrolls up for output of an Ex command, popups move too, so
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
80 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
81
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
82 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
83 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
84 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
85
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
86
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 IMPLEMENTATION:
16880
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
89 - 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
90 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window.
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
91 Use NOT_IN_POPUP_WINDOW for more commands.
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
92 - Add 'balloonpopup': instead of showing text, let the callback open a popup
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
93 window and return the window ID. The popup will then be closed when the
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
94 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
95 - For the "moved" property also include mouse movement?
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
96 - When selecting text in the popup with modeless selection, do not select
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
97 outside of the popup and don't select the border or padding.
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
98 - Allow the user to drag the popup window when the "dragging" property is set.
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
99 - 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
100 - 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
101 - 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
102 - 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
103 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
104 if wrapping inserts indent
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
105 - 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
106 incomplete cell.
16829
5cebaecad422 patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16817
diff changeset
107 - Can the buffer be re-used, to avoid using up lots of buffer numbers?
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
108 - Implement all the unimplemented options and features.
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
109
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 ==============================================================================
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 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
113
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
114 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
115
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
116 Creating a popup window:
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
117 |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
118 |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
119 the cursor moves away
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
120 |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
121 |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
122 |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
123
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
124 Manipulating a popup window:
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
125 |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
126 |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
127 |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
128 |popup_setoptions()| override options of a popup
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 Closing popup windows:
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
131 |popup_close()| close one popup
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
132 |popup_clear()| close all popups
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
133
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
134 Filter functions:
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
135 |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
136 |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
137
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
138 Other:
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
139 |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
140 |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
141
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
142
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
143 [functions 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
144
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
145 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
146 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
147 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
148 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
149 \ 'pos': 'botleft',
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
150 \ '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
151 \ 'col': 'cursor',
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
152 \ 'moved': 'WORD',
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
153 \ })
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
154 < 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
155
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
156
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
157 *popup_clear()*
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
158 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
159 windows.
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
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
162 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
163 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
164 be deleted.
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
165
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
166 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
167 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
168 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
169 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
170
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
171
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
172 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
173 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
174 - a string
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
175 - 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
176 - a list of text lines with text properties
16871
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
177
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 {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
179 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
180
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
181 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
182 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
183 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
184 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
185 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
186 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
187 < 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
188
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
189
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
190 popup_dialog({text}, {options}) *popup_dialog()*
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
191 {not implemented yet}
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
192 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
193 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
194 \ 'pos': 'center',
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
195 \ 'zindex': 200,
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
196 \ 'border': [],
16890
5131023c5728 patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16888
diff changeset
197 \ 'padding': [],
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
198 \})
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
199 < Use {options} to change the properties. E.g. add a 'filter'
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
200 option with value 'popup_filter_yesno'.
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
201
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
202
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
203 popup_filter_menu({id}, {key}) *popup_filter_menu()*
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
204 {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
205 Filter that can be used for a popup. It handles the cursor
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
206 keys to move the selected index in the popup. Space and Enter
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 can be used to select an item. 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
208 popup menu with the index of the selected line as the second
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
209 argument.
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
211
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212 popup_filter_yesno({id}, {key}) *popup_filter_yesno()*
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
213 {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
214 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
215 '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
216 popup menu with the 1 for 'y' or 'Y' and zero for 'n' or 'N'
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 as the second argument. Pressing Esc and CTRL-C works like
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
218 pressing 'n'. Other 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
219
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 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
222 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
223 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
224 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
225
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
226 The "highlight" entry is omitted, use the 'wincolor' option
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
227 for that: >
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
228 let hl = getwinvar(winid, '&wincolor')
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
229
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
230 < 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
231
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
232
16855
19162ff4eacd patch 8.1.1429: "pos" option of popup window not supported yet
Bram Moolenaar <Bram@vim.org>
parents: 16853
diff changeset
233 popup_getpos({id}) *popup_getpos()*
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
234 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
235 with these entries:
16841
cf630fab9fb6 patch 8.1.1422: popup_getoptions() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16833
diff changeset
236 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
237 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
238 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
239 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
240 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
241 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
242 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
243 core_height height of the text box in screen cells
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
244 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
245 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
246 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
247 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
248
59e4148c0c73 patch 8.1.1443: popup window padding and border not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16880
diff changeset
249 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
250
16829
5cebaecad422 patch 8.1.1416: popup_getposition() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16817
diff changeset
251 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
252
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
253
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
254 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
255 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
256 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
257 hidden.
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
258 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
259 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
260
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
261
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
262 popup_menu({text}, {options}) *popup_menu()*
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
263 {not implemented yet}
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
264 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
265 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
266 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
267 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
268 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
269 \ 'pos': 'center',
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
270 \ 'zindex': 200,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
271 \ 'wrap': 0,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
272 \ 'border': [],
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
273 \ '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
274 \ })
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
275 < Use {options} to change the properties. Should at least set
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
276 "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
277
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
278
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
279 popup_move({id}, {options}) *popup_move()*
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
280 Move popup {id} to the position speficied with {options}.
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
281 {options} may contain the items from |popup_create()| that
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
282 specify the popup position: "line", "col", "pos", "maxheight",
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
283 "minheight", "maxwidth" and "minwidth".
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
284 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
285
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 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
288 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
289 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
290 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
291 \ 'line': 1,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
292 \ 'col': 10,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
293 \ 'time': 3000,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
294 \ 'tab': -1,
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,
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
296 \ 'highlight': 'WarningMsg',
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
297 \ 'border': [],
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
298 \ '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
299 \ })
17045
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
300 < The position will be adjusted to avoid overlap with other
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
301 notifications.
7fe328ad5573 patch 8.1.1522: poup_notification() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 17036
diff changeset
302 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
303
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
304
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
305 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
306 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
307 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
308
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
309
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
310 popup_setoptions({id}, {options}) *popup_setoptions()*
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
311 {not implemented yet}
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
312 Override options in popup {id} with entries in {options}.
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
313
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
314
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
315
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
316 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
317
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
318 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
319 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
320 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
321 - the buffer has no name
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
322 - '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
323 - '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
324 - '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
325 - 'buflisted' is off
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
326 - '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
327 - 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
328 value.
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
329
16853
e6bcccccbf7b patch 8.1.1428: popup_atcursor() not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16841
diff changeset
330 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
331 might break then, so better leave them alone.
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16806
diff changeset
332
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
333 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
334
16833
6699c03347d2 patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16829
diff changeset
335 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
336 `win_execute()`. Example: >
6699c03347d2 patch 8.1.1418: win_execute() is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16829
diff changeset
337 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
338
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
339 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
340 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
341 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
342 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
343 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
344 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
345
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
346
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
347 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
348
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
349 The first argument of |popup_create()| specifies the text to be displayed, and
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
350 optionally text properties. It is in one of three forms:
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
351 - a string
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
352 - 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
353 - 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
354 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
355 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
356 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
357 |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
358 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
359 |popup-props|.
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
360
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
361 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
362 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
363 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
364 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
365 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
366 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
367 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
368 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
369 "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
370 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
371 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
372 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
373 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
374 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
375 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
376 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
377 "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
378 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
379 - "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
380 - "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
381 - 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
382 the screen, then
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
383 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
384 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
385 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
386 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
387 avoid overlap with the |popupmenu-completion| or
16896
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
388 another popup with a higher "zindex".
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
389 {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
390 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
391 padding.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
392 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
393 padding.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
394 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
395 padding.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
396 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
397 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
398 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
399 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
400 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
401 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
402 `popup_show()` to unhide it.
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
403 {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
404 tab When -1: display the popup on all tabs.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
405 When 0 (the default): display the popup on the current
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
406 tab.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
407 Otherwise the number of the tab page the popup is
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
408 displayed on; when invalid the current tab is used.
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
409 {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
410 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
411 popup, on top of any border. If there is no top
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
412 border on line of padding is added to put the title on.
16778
eda4d65f232c patch 8.1.1391: no popup window support
Bram Moolenaar <Bram@vim.org>
parents: 16724
diff changeset
413 {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
414 wrap TRUE to make the lines wrap (default TRUE).
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
415 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
416 the 'wincolor' option.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
417 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
418 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
419 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
420 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
421 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
422 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
423 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
424 the left.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
425 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
426 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
427 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
428 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
429 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
430 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
431 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
432 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
433 'LeftColor']
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
434 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
435 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
436 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
437 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
438 Example: ['-', '|', '-', '|', '┌', '┐', '┘', '└']
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
439 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
440 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
441 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
442 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
443 '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
444 used.
17026
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
445 zindex Priority for the popup, default 50. Mininum value is
905e1b154058 patch 8.1.1513: all popup functionality is in functions, except :popupclear
Bram Moolenaar <Bram@vim.org>
parents: 16944
diff changeset
446 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
447 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
448 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
449 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
450 - "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
451 - "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
452 - "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
453 - [{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
454 {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
455 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
456 line or to another window.
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
457 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
458 |popup-filter|.
52fc577a087d patch 8.1.1449: popup text truncated at end of screen
Bram Moolenaar <Bram@vim.org>
parents: 16890
diff changeset
459 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
460 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
461
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
462 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
463 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
464 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
465
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
466 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
467 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
468 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
469
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
470
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
471 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
472
16811
0457d49eb2d9 patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents: 16809
diff changeset
473 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
474 - "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
475 - "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
476 - "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
477 - "transparent" is extra
0457d49eb2d9 patch 8.1.1407: popup_create() does not support text properties
Bram Moolenaar <Bram@vim.org>
parents: 16809
diff changeset
478 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
479 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
480 first column.
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
481 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
482 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
483 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
484 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
485 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
486 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
487 used
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
488 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
489 |prop_type_add()|
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
490 transparent do not show these characters, show the text under it;
16871
e5dab34ded73 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16859
diff changeset
491 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
492 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
493 {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
494
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
495
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
496 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
497
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
498 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
499 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
500
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
501 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
502 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
503 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
504 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
505 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
506
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
507 The filter function is called with two arguments: the ID of the popup and the
16880
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
508 key, e.g.: >
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
509 func MyFilter(winid, key)
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
510 if a:key == "\<F2>"
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
511 " do something
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
512 return 1
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
513 endif
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
514 if a:key == 'x'
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
515 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
516 return 1
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
517 endif
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
518 return 0
17036
235cbf491430 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17026
diff changeset
519 endfunc
16880
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
520
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
521 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
522
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
523 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
524 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
525 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
526 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
527
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
528 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
529 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
530 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
531
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
532 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
533 |popup_filter_yesno()|.
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
534
16880
998603a243d7 patch 8.1.1441: popup window filter not yet implemented
Bram Moolenaar <Bram@vim.org>
parents: 16871
diff changeset
535 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
536 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
537 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
538 '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
539
16654
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 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
542
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
543 A callback that is invoked when the popup closes. Used by
16890
5131023c5728 patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16888
diff changeset
544 |popup_filter_menu()|.
5131023c5728 patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16888
diff changeset
545
5131023c5728 patch 8.1.1446: popup window callback not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16888
diff changeset
546 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
547 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
548 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
549
16904
9138e2c60bf1 patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16896
diff changeset
550 If the popup is closed because the cursor moved, the number -1 is passed to
9138e2c60bf1 patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16896
diff changeset
551 the callback.
9138e2c60bf1 patch 8.1.1453: popup window "moved" property not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 16896
diff changeset
552
16654
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
553 ==============================================================================
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
554 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
555
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
556 TODO
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
557
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
558 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
559
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
560 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
561 if a:result
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
562 " ... '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
563 endif
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
564 endfunc
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
565
16724
6030631a1541 patch 8.1.1364: design for popup window support needs more details
Bram Moolenaar <Bram@vim.org>
parents: 16654
diff changeset
566 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
567 \ '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
568 \ 'callback': 'MyDialogHandler',
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
7d54a66c95d7 patch 8.1.1329: plans for popup window support are spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
572 vim:tw=78:ts=8:noet:ft=help:norl: