diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-16 19:05:31 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-16 19:05:31 +0200 |
commit | a730e55cc2d3045a79a340a5af1ad4a749058a32 (patch) | |
tree | 91bd4f6fa1348c3d132198a857ec98902239d43f /runtime | |
parent | 983f2f1403a591779f6edc4dd973c6cf31c65c8b (diff) | |
download | vim-git-a730e55cc2d3045a79a340a5af1ad4a749058a32.tar.gz |
patch 8.1.1558: popup_menu() and popup_filter_menu() are not implemented yetv8.1.1558
Problem: Popup_menu() and popup_filter_menu() are not implemented yet.
Solution: Implement the functions. Fix that centering didn't take the border
and padding into account.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/popup.txt | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index 02c66c3b3..a6dab8b91 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -89,7 +89,7 @@ that it is in. TODO: - Why does 'nrformats' leak from the popup window buffer??? - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. - Use NOT_IN_POPUP_WINDOW for more commands. + Use ERROR_IF_POPUP_WINDOW for more commands. - Add 'balloonpopup': instead of showing text, let the callback open a popup window and return the window ID. The popup will then be closed when the mouse moves, except when it moves inside the popup. @@ -109,8 +109,6 @@ TODO: - When the lines do not fit show a scrollbar (like in the popup menu). Use the mouse wheel for scrolling. - Implement: - popup_filter_menu({id}, {key}) - popup_menu({text}, {options}) popup_setoptions({id}, {options}) hidden option tabpage option with number @@ -220,12 +218,20 @@ popup_dialog({text}, {options}) *popup_dialog()* popup_filter_menu({id}, {key}) *popup_filter_menu()* - {not implemented yet} - Filter that can be used for a popup. It handles the cursor - keys to move the selected index in the popup. Space and Enter - can be used to select an item. Invokes the "callback" of the - popup menu with the index of the selected line as the second - argument. + Filter that can be used for a popup. These keys can be used: + j <Down> select item below + k <Up> select item above + <Space> <Enter> accept current selection + x Esc CTRL-C cancel the menu + Other keys are ignored. + + A match is set on that line to highlight it, see + |popup_menu()|. + + When the current selection is accepted the "callback" of the + popup menu is invoked with the index of the selected line as + the second argument. The first entry has index one. + Cancelling the menu invokes the callback with -1. popup_filter_yesno({id}, {key}) *popup_filter_yesno()* @@ -279,7 +285,6 @@ popup_hide({id}) *popup_hide()* popup_menu({text}, {options}) *popup_menu()* - {not implemented yet} Show the {text} near the cursor, handle selecting one of the items with cursorkeys, and close it an item is selected with Space or Enter. {text} should have multiple lines to make this @@ -287,11 +292,16 @@ popup_menu({text}, {options}) *popup_menu()* call popup_create({text}, { \ 'pos': 'center', \ 'zindex': 200, + \ 'drag': 1, \ 'wrap': 0, \ 'border': [], + \ 'padding': [], \ 'filter': 'popup_filter_menu', \ }) -< Use {options} to change the properties. Should at least set +< The current line is highlighted with a match using + PopupSelected, or |PmenuSel| if that is not defined. + + Use {options} to change the properties. Should at least set "callback" to a function that handles the selected item. @@ -320,7 +330,8 @@ popup_notification({text}, {options}) *popup_notification()* \ }) < The PopupNotification highlight group is used instead of WarningMsg if it is defined. -< The position will be adjusted to avoid overlap with other + + The position will be adjusted to avoid overlap with other notifications. Use {options} to change the properties. |