Skip to content

Commit 794e445

Browse files
authored
Merge pull request #743 from ravelll/popup-txt-ravelll
Update popup.{txt, jax}
2 parents 1375750 + 3c92b62 commit 794e445

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

doc/popup.jax

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
*popup.txt* For Vim バージョン 8.1. Last change: 2019 Nov 03
1+
*popup.txt* For Vim バージョン 8.2. Last change: 2019 Nov 30
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
55

66

7-
フローティングウィンドウにテキストを表示する。 *popup* *popup-window*
7+
フローティングウィンドウにテキストを表示する。*popup* *popup-window* *popupwin*
88

99

1010
1. 前書き |popup-intro|
@@ -24,7 +24,7 @@
2424
3. 例 |popup-examples|
2525

2626

27-
{|+textprop| 機能無効でコンパイルされたときは使用できない}
27+
{|+popupwin| 機能無効でコンパイルされたときは使用できない}
2828

2929
==============================================================================
3030
1. 前書き *popup-intro*
@@ -187,6 +187,8 @@ popup_atcursor({what}, {options}) *popup_atcursor()*
187187
\ moved: 'WORD',
188188
\ })
189189
< プロパティを変更するには {options} を使用する。
190+
"pos" が "topleft" として渡された場合、"line" のデフォルトは
191+
"cursor+1" になる。
190192

191193
|method| としても使用できる: >
192194
GetText()->popup_atcursor({})
@@ -365,7 +367,8 @@ popup_getpos({id}) *popup_getpos()*
365367
core_height 画面セル内のテキストボックスの高さ
366368
firstline 上端のバッファの行(スクロールされていない限り1)
367369
("firstline" のプロパティの値ではない)
368-
lastline 下端のバッファの行
370+
lastline 下端のバッファの行(ポップアップの再描画時に更
371+
新される)
369372
scrollbar スクロールバーが表示されていれば非0
370373
visible ポップアップが表示されている場合は 1、非表示の
371374
場合は 0
@@ -570,6 +573,10 @@ popup_create() に渡す。
570573
用される。あるいは "center" を使ってポップアップをVim
571574
のウィンドウの中央に配置することもできる。その場合は
572575
"line" と "col" は無視される。
576+
posinvert FALSE の場合、"pos" の値が常に使用される。TRUE (デフォ
577+
ルト)で、ポップアップが垂直に収まらず、反対側により多
578+
くのスペースがある場合、ポップアップは "line" で示され
579+
る位置の反対側に配置される。
573580
textprop 指定した場合、ポップアップはこの名前のテキストプロパ
574581
ティの隣に配置され、テキストプロパティが移動すると移動
575582
する。削除するには空の文字列を使用すること。
@@ -680,6 +687,8 @@ popup_create() に渡す。
680687
- [{lnum}, {start}, {end}]: カーソルが行 {lnum} から離
681688
れた場合、または、桁が {start} の前、または {end}
682689
後に移動した場合
690+
- [0, 0, 0]: カーソルが移動するときにポップアップを閉
691+
じない
683692
カーソルが別の行または別のウィンドウに移動した場合も
684693
ポップアップは閉じる。
685694
mousemoved "moved" に似ているが、マウスポインタの位置を参照する。
@@ -842,9 +851,7 @@ zindex を持つポップアップウィンドウのフィルタが最初に呼
842851
cursor keys 別のエントリを選択
843852
Tab 現在の提案を受け入れる
844853

845-
マウスクリックは <LeftMouse> として届く。座標は v:mouse_popup_col および
846-
v:mouse_popup_row である。ポップアップの左上の画面セルは、桁 1、行 1である(ボー
847-
ダーはカウントしない)。
854+
マウスクリックは <LeftMouse> として届く。座標は |getmousepos()| で取得できる。
848855

849856
Vimは標準のフィルタ |popup_filter_menu()||popup_filter_yesno()| を提供す
850857
る。

en/popup.txt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
*popup.txt* For Vim version 8.1. Last change: 2019 Nov 03
1+
*popup.txt* For Vim version 8.2. Last change: 2019 Nov 30
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
55

66

7-
Displaying text in a floating window. *popup* *popup-window*
7+
Displaying text in a floating window. *popup* *popup-window* *popupwin*
88

99

1010
1. Introduction |popup-intro|
@@ -24,7 +24,7 @@ Displaying text in a floating window. *popup* *popup-window*
2424
4. Examples |popup-examples|
2525

2626

27-
{not available if the |+textprop| feature was disabled at compile time}
27+
{not available if the |+popupwin| feature was disabled at compile time}
2828

2929
==============================================================================
3030
1. Introduction *popup-intro*
@@ -186,6 +186,8 @@ popup_atcursor({what}, {options}) *popup_atcursor()*
186186
\ moved: 'WORD',
187187
\ })
188188
< Use {options} to change the properties.
189+
If "pos" is passed as "topleft" then the default for "line"
190+
becomes "cursor+1".
189191

190192
Can also be used as a |method|: >
191193
GetText()->popup_atcursor({})
@@ -362,7 +364,8 @@ popup_getpos({id}) *popup_getpos()*
362364
core_height height of the text box in screen cells
363365
firstline line of the buffer at top (1 unless scrolled)
364366
(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)
366369
scrollbar non-zero if a scrollbar is displayed
367370
visible one if the popup is displayed, zero if hidden
368371
Note that these are the actual screen positions. They differ
@@ -566,6 +569,11 @@ The second argument of |popup_create()| is a dictionary with options:
566569
Alternatively "center" can be used to position the
567570
popup in the center of the Vim window, in which case
568571
"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".
569577
textprop When present the popup is positioned next to a text
570578
property with this name and will move when the text
571579
property moves. Use an empty string to remove. See
@@ -686,6 +694,8 @@ The second argument of |popup_create()| is a dictionary with options:
686694
- [{lnum}, {start}, {end}]: if the cursor moved away
687695
from line {lnum}, before column {start} or after
688696
{end}
697+
- [0, 0, 0] do not close the popup when the cursor
698+
moves
689699
The popup also closes if the cursor moves to another
690700
line or to another window.
691701
mousemoved Like "moved" but referring to the mouse pointer
@@ -852,9 +862,8 @@ Some recommended key actions:
852862
cursor keys select another entry
853863
Tab accept current suggestion
854864

855-
A mouse click arrives as <LeftMouse>. The coordinates are in
856-
v:mouse_popup_col and v:mouse_popup_row. The top-left screen cell of the
857-
popup is col 1, row 1 (not counting the border).
865+
A mouse click arrives as <LeftMouse>. The coordinates can be obtained with
866+
|getmousepos()|.
858867

859868
Vim provides standard filters |popup_filter_menu()| and
860869
|popup_filter_yesno()|.

0 commit comments

Comments
 (0)