summaryrefslogtreecommitdiffstats
path: root/runtime/doc/popup.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-03 21:59:47 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-03 21:59:47 +0100
commitcfa8f9a3f285060152ebbdbf86fbc7aecf1dd756 (patch)
tree8aa47aedb1518be5e85a39a24afc93c80878eb7d /runtime/doc/popup.txt
parent635f48010dcf6d97f3a65b4785e1726ad386d3eb (diff)
Update runtime files
Diffstat (limited to 'runtime/doc/popup.txt')
-rw-r--r--runtime/doc/popup.txt28
1 files changed, 16 insertions, 12 deletions
diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index 51413e7964..dd478aefeb 100644
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -1,4 +1,4 @@
-*popup.txt* For Vim version 8.2. Last change: 2022 Apr 04
+*popup.txt* For Vim version 8.2. Last change: 2022 May 29
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
different: *E863*
- The popup window always has focus, it is not possible to switch to another
window.
-- When the job ends, the popup window closes.
+- When the job ends, the popup window shows the buffer in Terminal-Normal
+ mode. Use `:q` to close it or use "term_finish" value "close".
- The popup window can be closed with `popup_close()`, the terminal buffer
then becomes hidden.
- It is not possible to open a second popup window with a terminal. *E861*
@@ -998,20 +999,23 @@ To make the four corners transparent:
==============================================================================
4. Examples *popup-examples*
+These examplese use |Vim9| script.
+
TODO: more interesting examples
+
*popup_dialog-example*
Prompt the user to press y/Y or n/N: >
- func MyDialogHandler(id, result)
- if a:result
- " ... 'y' or 'Y' was pressed
- endif
- endfunc
-
- call popup_dialog('Continue? y/n', #{
- \ filter: 'popup_filter_yesno',
- \ callback: 'MyDialogHandler',
- \ })
+ popup_dialog('Continue? y/n', {
+ filter: 'popup_filter_yesno',
+ callback: (id, result) => {
+ if result == 1
+ echomsg "'y' or 'Y' was pressed"
+ else
+ echomsg "'y' or 'Y' was NOT pressed"
+ endif
+ },
+ })
<
*popup_menu-shortcut-example*
Extend popup_filter_menu() with shortcut keys: >