Mercurial > vim
comparison runtime/doc/popup.txt @ 18558:e5ef5d820b5b v8.1.2273
patch 8.1.2273: wrong default when "pos" is changed with popup_atcursor()
Commit: https://github.com/vim/vim/commit/4dd8fe0b4f49ec267640fb457672452825b11df0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 9 15:33:31 2019 +0100
patch 8.1.2273: wrong default when "pos" is changed with popup_atcursor()
Problem: Wrong default when "pos" is changed with popup_atcursor().
Solution: Adjust the default line and col when "pos" is not the default
value. (#5151)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 09 Nov 2019 15:45:04 +0100 |
parents | e855058e0c23 |
children | b10ef01555c8 |
comparison
equal
deleted
inserted
replaced
18557:6b3126903e2e | 18558:e5ef5d820b5b |
---|---|
1 *popup.txt* For Vim version 8.1. Last change: 2019 Nov 03 | 1 *popup.txt* For Vim version 8.1. Last change: 2019 Nov 09 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
184 \ line: 'cursor-1', | 184 \ line: 'cursor-1', |
185 \ col: 'cursor', | 185 \ col: 'cursor', |
186 \ moved: 'WORD', | 186 \ moved: 'WORD', |
187 \ }) | 187 \ }) |
188 < Use {options} to change the properties. | 188 < Use {options} to change the properties. |
189 If "pos" is passed as "topleft" then the default for "line" | |
190 becomes "cursor+1". | |
189 | 191 |
190 Can also be used as a |method|: > | 192 Can also be used as a |method|: > |
191 GetText()->popup_atcursor({}) | 193 GetText()->popup_atcursor({}) |
192 | 194 |
193 | 195 |
360 core_line screen line of the text box | 362 core_line screen line of the text box |
361 core_width width of the text box in screen cells | 363 core_width width of the text box in screen cells |
362 core_height height of the text box in screen cells | 364 core_height height of the text box in screen cells |
363 firstline line of the buffer at top (1 unless scrolled) | 365 firstline line of the buffer at top (1 unless scrolled) |
364 (not the value of the "firstline" property) | 366 (not the value of the "firstline" property) |
365 lastline line of the buffer at the bottom | 367 lastline line of the buffer at the bottom (updated when |
368 the popup is redrawn) | |
366 scrollbar non-zero if a scrollbar is displayed | 369 scrollbar non-zero if a scrollbar is displayed |
367 visible one if the popup is displayed, zero if hidden | 370 visible one if the popup is displayed, zero if hidden |
368 Note that these are the actual screen positions. They differ | 371 Note that these are the actual screen positions. They differ |
369 from the values in `popup_getoptions()` for the sizing and | 372 from the values in `popup_getoptions()` for the sizing and |
370 positioning mechanism applied. | 373 positioning mechanism applied. |
564 defines what corner of the popup "line" and "col" are | 567 defines what corner of the popup "line" and "col" are |
565 used for. When not set "topleft" is used. | 568 used for. When not set "topleft" is used. |
566 Alternatively "center" can be used to position the | 569 Alternatively "center" can be used to position the |
567 popup in the center of the Vim window, in which case | 570 popup in the center of the Vim window, in which case |
568 "line" and "col" are ignored. | 571 "line" and "col" are ignored. |
572 posinvert When FALSE the value of "pos" is always used. When | |
573 TRUE (the default) and the popup does not fit | |
574 vertically and there is more space on the other side | |
575 then the popup is placed on the other side of the | |
576 position indicated by "line". | |
569 textprop When present the popup is positioned next to a text | 577 textprop When present the popup is positioned next to a text |
570 property with this name and will move when the text | 578 property with this name and will move when the text |
571 property moves. Use an empty string to remove. See | 579 property moves. Use an empty string to remove. See |
572 |popup-textprop-pos|. | 580 |popup-textprop-pos|. |
573 textpropwin What window to search for the text property. When | 581 textpropwin What window to search for the text property. When |
684 - [{start}, {end}]: if the cursor moved before column | 692 - [{start}, {end}]: if the cursor moved before column |
685 {start} or after {end} | 693 {start} or after {end} |
686 - [{lnum}, {start}, {end}]: if the cursor moved away | 694 - [{lnum}, {start}, {end}]: if the cursor moved away |
687 from line {lnum}, before column {start} or after | 695 from line {lnum}, before column {start} or after |
688 {end} | 696 {end} |
697 - [0, 0, 0] do not close the popup when the cursor | |
698 moves | |
689 The popup also closes if the cursor moves to another | 699 The popup also closes if the cursor moves to another |
690 line or to another window. | 700 line or to another window. |
691 mousemoved Like "moved" but referring to the mouse pointer | 701 mousemoved Like "moved" but referring to the mouse pointer |
692 position | 702 position |
693 cursorline non-zero: Highlight the cursor line. Also scrolls the | 703 cursorline non-zero: Highlight the cursor line. Also scrolls the |
850 Some recommended key actions: | 860 Some recommended key actions: |
851 x close the popup (see note below) | 861 x close the popup (see note below) |
852 cursor keys select another entry | 862 cursor keys select another entry |
853 Tab accept current suggestion | 863 Tab accept current suggestion |
854 | 864 |
855 A mouse click arrives as <LeftMouse>. The coordinates are in | 865 A mouse click arrives as <LeftMouse>. The coordinates are in |v:mouse_col| |
856 v:mouse_popup_col and v:mouse_popup_row. The top-left screen cell of the | 866 and |v:mouse_lnum|. The top-left screen cell of the popup is col 1, row 1 |
857 popup is col 1, row 1 (not counting the border). | 867 (not counting the border). |
858 | 868 |
859 Vim provides standard filters |popup_filter_menu()| and | 869 Vim provides standard filters |popup_filter_menu()| and |
860 |popup_filter_yesno()|. | 870 |popup_filter_yesno()|. |
861 | 871 |
862 Note that "x" is the normal way to close a popup. You may want to use Esc, | 872 Note that "x" is the normal way to close a popup. You may want to use Esc, |