Mercurial > vim
comparison runtime/doc/popup.txt @ 17946:ec4248c4b92c v8.1.1969
patch 8.1.1969: popup window filter is used in all modes
Commit: https://github.com/vim/vim/commit/581ba39aefe837298a9943b04a1dab13a7ec6772
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 3 22:08:33 2019 +0200
patch 8.1.1969: popup window filter is used in all modes
Problem: Popup window filter is used in all modes.
Solution: Add the "filtermode" property.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 03 Sep 2019 22:15:03 +0200 |
parents | cc953757ed2a |
children | a170c48e0f91 |
comparison
equal
deleted
inserted
replaced
17945:dffad5c9361e | 17946:ec4248c4b92c |
---|---|
1 *popup.txt* For Vim version 8.1. Last change: 2019 Aug 31 | 1 *popup.txt* For Vim version 8.1. Last change: 2019 Sep 03 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
440 \ padding: [0,1,0,1], | 440 \ padding: [0,1,0,1], |
441 \ }) | 441 \ }) |
442 < The PopupNotification highlight group is used instead of | 442 < The PopupNotification highlight group is used instead of |
443 WarningMsg if it is defined. | 443 WarningMsg if it is defined. |
444 | 444 |
445 Without the |+timers| feature the poup will not disappear | 445 Without the |+timers| feature the popup will not disappear |
446 automatically, the user has to click in it. | 446 automatically, the user has to click in it. |
447 | 447 |
448 The position will be adjusted to avoid overlap with other | 448 The position will be adjusted to avoid overlap with other |
449 notifications. | 449 notifications. |
450 Use {options} to change the properties. | 450 Use {options} to change the properties. |
484 The options from |popup_move()| can also be used. | 484 The options from |popup_move()| can also be used. |
485 For "hidden" use |popup_hide()| and |popup_show()|. | 485 For "hidden" use |popup_hide()| and |popup_show()|. |
486 "tabpage" cannot be changed. | 486 "tabpage" cannot be changed. |
487 | 487 |
488 popup_settext({id}, {text}) *popup_settext()* | 488 popup_settext({id}, {text}) *popup_settext()* |
489 Set the text of the buffer in poup win {id}. {text} is the | 489 Set the text of the buffer in popup win {id}. {text} is the |
490 same as supplied to |popup_create()|, except that a buffer | 490 same as supplied to |popup_create()|, except that a buffer |
491 number is not allowed. | 491 number is not allowed. |
492 Does not change the window size or position, other than caused | 492 Does not change the window size or position, other than caused |
493 by the different text. | 493 by the different text. |
494 | 494 |
581 border one line of padding is added to put the title | 581 border one line of padding is added to put the title |
582 on. You might want to add one or more spaces at the | 582 on. You might want to add one or more spaces at the |
583 start and end as padding. | 583 start and end as padding. |
584 wrap TRUE to make the lines wrap (default TRUE). | 584 wrap TRUE to make the lines wrap (default TRUE). |
585 drag TRUE to allow the popup to be dragged with the mouse | 585 drag TRUE to allow the popup to be dragged with the mouse |
586 by grabbing at at the border. Has no effect if the | 586 by grabbing at the border. Has no effect if the |
587 popup does not have a border. As soon as dragging | 587 popup does not have a border. As soon as dragging |
588 starts and "pos" is "center" it is changed to | 588 starts and "pos" is "center" it is changed to |
589 "topleft". | 589 "topleft". |
590 resize TRUE to allow the popup to be resized with the mouse | 590 resize TRUE to allow the popup to be resized with the mouse |
591 by grabbing at at the bottom right cornder. Has no | 591 by grabbing at the bottom right corner. Has no effect |
592 effect if the popup does not have a border. | 592 if the popup does not have a border. |
593 close When "button" an X is displayed in the top-right, on | 593 close When "button" an X is displayed in the top-right, on |
594 top of any border, padding or text. When clicked on | 594 top of any border, padding or text. When clicked on |
595 the X the popup will close. Any callback is invoked | 595 the X the popup will close. Any callback is invoked |
596 with the value -2. | 596 with the value -2. |
597 When "click" any mouse click in the popup will close | 597 When "click" any mouse click in the popup will close |
660 filter A callback that can filter typed characters, see | 660 filter A callback that can filter typed characters, see |
661 |popup-filter|. | 661 |popup-filter|. |
662 mapping Allow for key mapping. When FALSE and the popup is | 662 mapping Allow for key mapping. When FALSE and the popup is |
663 visible and has a filter callback key mapping is | 663 visible and has a filter callback key mapping is |
664 disabled. Default value is TRUE. | 664 disabled. Default value is TRUE. |
665 filtermode In which modes the filter is used (same flags as with | |
666 |hasmapto()| plus "a"): | |
667 n Normal mode | |
668 v Visual and Select mode | |
669 x Visual mode | |
670 s Select mode | |
671 o Operator-pending mode | |
672 i Insert mode | |
673 l Language-Argument ("r", "f", "t", etc.) | |
674 c Command-line mode | |
675 a all modes | |
676 The default value is "a". | |
665 callback A callback that is called when the popup closes, e.g. | 677 callback A callback that is called when the popup closes, e.g. |
666 when using |popup_filter_menu()|, see |popup-callback|. | 678 when using |popup_filter_menu()|, see |popup-callback|. |
667 | 679 |
668 Depending on the "zindex" the popup goes under or above other popups. The | 680 Depending on the "zindex" the popup goes under or above other popups. The |
669 completion menu (|popup-menu|) has zindex 100. For messages that occur for a | 681 completion menu (|popup-menu|) has zindex 100. For messages that occur for a |
782 call popup_close(a:winid) | 794 call popup_close(a:winid) |
783 return 1 | 795 return 1 |
784 endif | 796 endif |
785 return 0 | 797 return 0 |
786 endfunc | 798 endfunc |
787 < *popup-mapping* | 799 < *popup-filter-mode* |
800 The "filtermode" property can be used to specify in what mode the filter is | |
801 invoked. The default is "a": all modes. When using "nvi" Command-line mode | |
802 is not included, so that any command typed on the command line is not | |
803 filtered. However, to get to Command-line mode the filter must not consume | |
804 ":". Just like it must not consume "v" to allow for entering Visual mode. | |
805 | |
806 *popup-mapping* | |
788 Normally the key is what results after any mapping, since the keys pass on as | 807 Normally the key is what results after any mapping, since the keys pass on as |
789 normal input if the filter does not use it. If the filter consumes all the | 808 normal input if the filter does not use it. If the filter consumes all the |
790 keys, set the "mapping" property to zero so that mappings do not get in the | 809 keys, set the "mapping" property to zero so that mappings do not get in the |
791 way. This is default for |popup_menu()| and |popup_dialog()|. | 810 way. This is default for |popup_menu()| and |popup_dialog()|. |
792 | 811 |
793 Some common key actions: | 812 Some recommended key actions: |
794 x close the popup (see note below) | 813 x close the popup (see note below) |
795 cursor keys select another entry | 814 cursor keys select another entry |
796 Tab accept current suggestion | 815 Tab accept current suggestion |
797 | 816 |
798 A mouse click arrives as <LeftMouse>. The coordinates are in | 817 A mouse click arrives as <LeftMouse>. The coordinates are in |
939 return '' | 958 return '' |
940 endif | 959 endif |
941 call popup_close(s:winid) | 960 call popup_close(s:winid) |
942 let s:winid = 0 | 961 let s:winid = 0 |
943 endif | 962 endif |
944 " simulate an asynchronous loopup for the text to display | 963 " simulate an asynchronous lookup for the text to display |
945 let s:balloonText = v:beval_text | 964 let s:balloonText = v:beval_text |
946 call timer_start(100, 'ShowPopup') | 965 call timer_start(100, 'ShowPopup') |
947 return '' | 966 return '' |
948 endfunc | 967 endfunc |
949 | 968 |