Skip to content

Commit 39ba640

Browse files
committed
popup.txt: Update Vim 8.2.5077
1 parent e824bd6 commit 39ba640

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

en/popup.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*popup.txt* For Vim version 8.2. Last change: 2022 Apr 04
1+
*popup.txt* For Vim version 8.2. Last change: 2022 Jun 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -147,7 +147,8 @@ A special case is running a terminal in a popup window. Many rules are then
147147
different: *E863*
148148
- The popup window always has focus, it is not possible to switch to another
149149
window.
150-
- When the job ends, the popup window closes.
150+
- When the job ends, the popup window shows the buffer in Terminal-Normal
151+
mode. Use `:q` to close it or use "term_finish" value "close".
151152
- The popup window can be closed with `popup_close()`, the terminal buffer
152153
then becomes hidden.
153154
- It is not possible to open a second popup window with a terminal. *E861*
@@ -998,20 +999,23 @@ To make the four corners transparent:
998999
==============================================================================
9991000
4. Examples *popup-examples*
10001001

1002+
These examples use |Vim9| script.
1003+
10011004
TODO: more interesting examples
1005+
10021006
*popup_dialog-example*
10031007
Prompt the user to press y/Y or n/N: >
10041008
1005-
func MyDialogHandler(id, result)
1006-
if a:result
1007-
" ... 'y' or 'Y' was pressed
1008-
endif
1009-
endfunc
1010-
1011-
call popup_dialog('Continue? y/n', #{
1012-
\ filter: 'popup_filter_yesno',
1013-
\ callback: 'MyDialogHandler',
1014-
\ })
1009+
popup_dialog('Continue? y/n', {
1010+
filter: 'popup_filter_yesno',
1011+
callback: (id, result) => {
1012+
if result == 1
1013+
echomsg "'y' or 'Y' was pressed"
1014+
else
1015+
echomsg "'y' or 'Y' was NOT pressed"
1016+
endif
1017+
},
1018+
})
10151019
<
10161020
*popup_menu-shortcut-example*
10171021
Extend popup_filter_menu() with shortcut keys: >
@@ -1039,6 +1043,10 @@ Extend popup_filter_menu() with shortcut keys: >
10391043
" No shortcut, pass to generic filter
10401044
return popup_filter_menu(a:id, a:key)
10411045
endfunc
1046+
1047+
func MyMenuHandler(id, result)
1048+
echo $'Result: {a:result}'
1049+
endfunc
10421050
<
10431051
*popup_beval_example*
10441052
Example for using a popup window for 'ballooneval': >

0 commit comments

Comments
 (0)