comparison runtime/doc/popup.txt @ 18343:375a7ecdb351

Update runtime files. Commit: https://github.com/vim/vim/commit/2e693a88b24dc6b12883fad78ff2cb9cd4469c98 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 16 22:35:02 2019 +0200 Update runtime files.
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Oct 2019 22:45:04 +0200
parents 9c3347b21b89
children 21c25bee9df8
comparison
equal deleted inserted replaced
18342:fedab77fee7b 18343:375a7ecdb351
359 core_col screen column of the text box 359 core_col screen column of the text box
360 core_line screen line of the text box 360 core_line screen line of the text box
361 core_width width of the text box in screen cells 361 core_width width of the text box in screen cells
362 core_height height of the text box in screen cells 362 core_height height of the text box in screen cells
363 firstline line of the buffer at top (1 unless scrolled) 363 firstline line of the buffer at top (1 unless scrolled)
364 (not the value of the "firstline" property) 364 (not the value of the "firstline" property)
365 scrollbar non-zero if a scrollbar is displayed 365 scrollbar non-zero if a scrollbar is displayed
366 visible one if the popup is displayed, zero if hidden 366 visible one if the popup is displayed, zero if hidden
367 Note that these are the actual screen positions. They differ 367 Note that these are the actual screen positions. They differ
368 from the values in `popup_getoptions()` for the sizing and 368 from the values in `popup_getoptions()` for the sizing and
369 positioning mechanism applied. 369 positioning mechanism applied.
742 is inserted or deleted. The popup functions like a tooltip. 742 is inserted or deleted. The popup functions like a tooltip.
743 743
744 These steps are needed to make this work: 744 These steps are needed to make this work:
745 745
746 - Define a text property type, it defines the name. > 746 - Define a text property type, it defines the name. >
747 call prop_type_add('popupMarker', {}) 747 call prop_type_add('popupMarker', {})
748 748
749 - Place a text property at the desired text: > 749 - Place a text property at the desired text: >
750 let lnum = {line of the text} 750 let lnum = {line of the text}
751 let col = {start column of the text} 751 let col = {start column of the text}
752 let len = {length of the text} 752 let len = {length of the text}
753 let propId = {arbitrary but unique number} 753 let propId = {arbitrary but unique number}
754 call prop_add(lnum, col, #{ 754 call prop_add(lnum, col, #{
755 \ length: len, 755 \ length: len,
756 \ type: 'popupMarker', 756 \ type: 'popupMarker',
757 \ id: propId, 757 \ id: propId,
758 \ }) 758 \ })
759 759
760 - Create a popup: > 760 - Create a popup: >
761 let winid = popup_create('the text', #{ 761 let winid = popup_create('the text', #{
762 \ pos: 'botleft', 762 \ pos: 'botleft',
763 \ textprop: 'popupMarker', 763 \ textprop: 'popupMarker',
764 \ textpropid: propId, 764 \ textpropid: propId,
765 \ border: [], 765 \ border: [],
766 \ padding: [0,1,0,1], 766 \ padding: [0,1,0,1],
767 \ close: 'click', 767 \ close: 'click',
797 property visible. 797 property visible.
798 - The popup may be in the way of what the user is doing, making it close with 798 - The popup may be in the way of what the user is doing, making it close with
799 a click, as in the example above, helps for that. 799 a click, as in the example above, helps for that.
800 - If the text property is removed the popup is closed. Use something like 800 - If the text property is removed the popup is closed. Use something like
801 this: > 801 this: >
802 call prop_remove(#{type: 'popupMarker', id: propId}) 802 call prop_remove(#{type: 'popupMarker', id: propId})
803 803
804 804
805 POPUP FILTER *popup-filter* 805 POPUP FILTER *popup-filter*
806 806
807 A callback that gets any typed keys while a popup is displayed. The filter is 807 A callback that gets any typed keys while a popup is displayed. The filter is