comparison runtime/doc/popup.txt @ 25700:d4faa2c5211b

Update runtime files Commit: https://github.com/vim/vim/commit/89a9c159f23fb7b3e24e6d09068adfc24a73afcb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 29 21:55:35 2021 +0200 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Aug 2021 22:00:05 +0200
parents 29ec2c198c8d
children 8b7f01b39d79
comparison
equal deleted inserted replaced
25699:8088e687c3d7 25700:d4faa2c5211b
1 *popup.txt* For Vim version 8.2. Last change: 2021 Aug 03 1 *popup.txt* For Vim version 8.2. Last change: 2021 Aug 15
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
258 Otherwise zero is passed to the callback. 258 Otherwise zero is passed to the callback.
259 259
260 Can also be used as a |method|: > 260 Can also be used as a |method|: >
261 GetPopup()->popup_close() 261 GetPopup()->popup_close()
262 262
263
263 popup_create({what}, {options}) *popup_create()* 264 popup_create({what}, {options}) *popup_create()*
264 Open a popup window showing {what}, which is either: 265 Open a popup window showing {what}, which is either:
265 - a buffer number 266 - a buffer number
266 - a string 267 - a string
267 - a list of strings 268 - a list of strings
281 call setbufline(bufnr, 2, 'second line') 282 call setbufline(bufnr, 2, 'second line')
282 < In case of failure zero is returned. 283 < In case of failure zero is returned.
283 284
284 Can also be used as a |method|: > 285 Can also be used as a |method|: >
285 GetText()->popup_create({}) 286 GetText()->popup_create({})
287
286 288
287 popup_dialog({what}, {options}) *popup_dialog()* 289 popup_dialog({what}, {options}) *popup_dialog()*
288 Just like |popup_create()| but with these default options: > 290 Just like |popup_create()| but with these default options: >
289 call popup_create({what}, #{ 291 call popup_create({what}, #{
290 \ pos: 'center', 292 \ pos: 'center',
305 can be read if needed. 307 can be read if needed.
306 308
307 Can also be used as a |method|: > 309 Can also be used as a |method|: >
308 GetText()->popup_dialog({}) 310 GetText()->popup_dialog({})
309 311
312
310 popup_filter_menu({id}, {key}) *popup_filter_menu()* 313 popup_filter_menu({id}, {key}) *popup_filter_menu()*
311 Filter that can be used for a popup. These keys can be used: 314 Filter that can be used for a popup. These keys can be used:
312 j <Down> <C-N> select item below 315 j <Down> <C-N> select item below
313 k <Up> <C-P> select item above 316 k <Up> <C-P> select item above
314 <Space> <Enter> accept current selection 317 <Space> <Enter> accept current selection
383 386
384 If popup window {id} is not found an empty Dict is returned. 387 If popup window {id} is not found an empty Dict is returned.
385 388
386 Can also be used as a |method|: > 389 Can also be used as a |method|: >
387 GetPopup()->popup_getoptions() 390 GetPopup()->popup_getoptions()
391
388 392
389 popup_getpos({id}) *popup_getpos()* 393 popup_getpos({id}) *popup_getpos()*
390 Return the position and size of popup {id}. Returns a Dict 394 Return the position and size of popup {id}. Returns a Dict
391 with these entries: 395 with these entries:
392 col screen column of the popup, one-based 396 col screen column of the popup, one-based
412 If popup window {id} is not found an empty Dict is returned. 416 If popup window {id} is not found an empty Dict is returned.
413 417
414 Can also be used as a |method|: > 418 Can also be used as a |method|: >
415 GetPopup()->popup_getpos() 419 GetPopup()->popup_getpos()
416 420
421
417 popup_hide({id}) *popup_hide()* 422 popup_hide({id}) *popup_hide()*
418 If {id} is a displayed popup, hide it now. If the popup has a 423 If {id} is a displayed popup, hide it now. If the popup has a
419 filter it will not be invoked for so long as the popup is 424 filter it will not be invoked for so long as the popup is
420 hidden. 425 hidden.
421 If window {id} does not exist nothing happens. If window {id} 426 If window {id} does not exist nothing happens. If window {id}
422 exists but is not a popup window an error is given. *E993* 427 exists but is not a popup window an error is given. *E993*
423 If popup window {id} contains a terminal an error is given. 428 If popup window {id} contains a terminal an error is given.
424 429
425 Can also be used as a |method|: > 430 Can also be used as a |method|: >
426 GetPopup()->popup_hide() 431 GetPopup()->popup_hide()
432
427 433
428 popup_list() *popup_list()* 434 popup_list() *popup_list()*
429 Return a List with the |window-ID| of all existing popups. 435 Return a List with the |window-ID| of all existing popups.
430 436
431 437
466 \ }) 472 \ })
467 473
468 < Can also be used as a |method|: > 474 < Can also be used as a |method|: >
469 GetChoices()->popup_menu({}) 475 GetChoices()->popup_menu({})
470 476
477
471 popup_move({id}, {options}) *popup_move()* 478 popup_move({id}, {options}) *popup_move()*
472 Move popup {id} to the position specified with {options}. 479 Move popup {id} to the position specified with {options}.
473 {options} may contain the items from |popup_create()| that 480 {options} may contain the items from |popup_create()| that
474 specify the popup position: 481 specify the popup position:
475 line 482 line
483 For {id} see `popup_hide()`. 490 For {id} see `popup_hide()`.
484 For other options see |popup_setoptions()|. 491 For other options see |popup_setoptions()|.
485 492
486 Can also be used as a |method|: > 493 Can also be used as a |method|: >
487 GetPopup()->popup_move(options) 494 GetPopup()->popup_move(options)
495
488 496
489 popup_notification({what}, {options}) *popup_notification()* 497 popup_notification({what}, {options}) *popup_notification()*
490 Show the {what} for 3 seconds at the top of the Vim window. 498 Show the {what} for 3 seconds at the top of the Vim window.
491 This works like: > 499 This works like: >
492 call popup_create({what}, #{ 500 call popup_create({what}, #{
512 notifications. 520 notifications.
513 Use {options} to change the properties. 521 Use {options} to change the properties.
514 522
515 Can also be used as a |method|: > 523 Can also be used as a |method|: >
516 GetText()->popup_notification({}) 524 GetText()->popup_notification({})
517
518 popup_show({id}) *popup_show()*
519 If {id} is a hidden popup, show it now.
520 For {id} see `popup_hide()`.
521 If {id} is the info popup it will be positioned next to the
522 current popup menu item.
523 525
524 526
525 popup_setoptions({id}, {options}) *popup_setoptions()* 527 popup_setoptions({id}, {options}) *popup_setoptions()*
526 Override options in popup {id} with entries in {options}. 528 Override options in popup {id} with entries in {options}.
527 These options can be set: 529 These options can be set:
555 "tabpage" cannot be changed. 557 "tabpage" cannot be changed.
556 558
557 Can also be used as a |method|: > 559 Can also be used as a |method|: >
558 GetPopup()->popup_setoptions(options) 560 GetPopup()->popup_setoptions(options)
559 561
562
560 popup_settext({id}, {text}) *popup_settext()* 563 popup_settext({id}, {text}) *popup_settext()*
561 Set the text of the buffer in popup win {id}. {text} is the 564 Set the text of the buffer in popup win {id}. {text} is the
562 same as supplied to |popup_create()|, except that a buffer 565 same as supplied to |popup_create()|, except that a buffer
563 number is not allowed. 566 number is not allowed.
564 Does not change the window size or position, other than caused 567 Does not change the window size or position, other than caused
565 by the different text. 568 by the different text.
566 569
567 Can also be used as a |method|: > 570 Can also be used as a |method|: >
568 GetPopup()->popup_settext('hello') 571 GetPopup()->popup_settext('hello')
572
573
574 popup_show({id}) *popup_show()*
575 If {id} is a hidden popup, show it now.
576 For {id} see `popup_hide()`.
577 If {id} is the info popup it will be positioned next to the
578 current popup menu item.
579
569 580
570 ============================================================================== 581 ==============================================================================
571 3. Usage *popup-usage* 582 3. Usage *popup-usage*
572 583
573 POPUP_CREATE() ARGUMENTS *popup_create-arguments* 584 POPUP_CREATE() ARGUMENTS *popup_create-arguments*