Skip to content

Commit c99f70a

Browse files
authored
Merge pull request #2627 from h-east/update-popup
Update popup.{txt,jax}
2 parents bf5f2c5 + f24f005 commit c99f70a

2 files changed

Lines changed: 72 additions & 2 deletions

File tree

doc/popup.jax

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*popup.txt* For Vim バージョン 9.2. Last change: 2026 May 01
1+
*popup.txt* For Vim バージョン 9.2. Last change: 2026 May 10
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -721,6 +721,15 @@ popup_create() に渡す。
721721
定された場合に使用される。
722722
textpropid "textprop" が指定された場合にテキストプロパティを識別
723723
するために使用される。0 を使用してリセットする。
724+
clipwindow "textprop" が設定されている場合にのみ使用される。TRUE
725+
の場合、ポップアップはテキストプロパティを含むウィンド
726+
ウ内に留まる。テキストプロパティがウィンドウの上端、下
727+
端、左端、または右端を超えてスクロールすると、ポップ
728+
アップはその端で切り取られ、ウィンドウの外に描画されな
729+
い。テキストプロパティがウィンドウの外にスクロールする
730+
と、ポップアップは非表示になる。
731+
デフォルトは FALSE である。
732+
|popup-clipwindow| を参照。
724733
fixed FALSE (デフォルト)の場合は:
725734
- "pos" は "botleft" または "topleft" で、
726735
- ポップアップは画面の右端で切り捨てられ、
@@ -945,6 +954,33 @@ popup_create() に渡す。
945954

946955
ポップアップが目的の位置に収まらない場合、近くの位置に表示される場合がある。
947956

957+
958+
*popup-clipwindow*
959+
☆テキストプロパティのポップアップをホストウィンドウ内に収める
960+
961+
分割ウィンドウ内のテキストプロパティにポップアップを固定すると、ポップアップは
962+
デフォルトでは画面全体を基準に描画され、テキストプロパティを含むウィンドウ
963+
("ホストウィンドウ") の端を超えて広がる場合がある。"clipwindow" を TRUE に設定
964+
すると、ポップアップはウィンドウのコンテンツ領域内に収まる。ウィンドウからはみ
965+
出したポップアップの部分は切り取られ、テキストプロパティがウィンドウの端を完全
966+
に超えてスクロールすると、ポップアップは非表示になる。
967+
968+
例: カーソルの上に固定された背の高いポップアップで、分割ウィンドウの下の領域に
969+
は決してはみ出さないもの: >
970+
call popup_create(body, #{
971+
\ textprop: 'marker',
972+
\ textpropid: id,
973+
\ pos: 'topleft',
974+
\ line: -1, col: 0,
975+
\ posinvert: v:false,
976+
\ clipwindow: v:true,
977+
\ })
978+
<
979+
"posinvert" をデフォルト値 (TRUE) のままにしておくと、十分なスペースがない場合
980+
にポップアップがテキストプロパティの反対側へ反転される可能性がある。指定された
981+
側を維持し、"clipwindow" ではみ出した部分をクリップするには、これを FALSE に設
982+
定する。
983+
948984
いくつかのヒント:
949985
- 他のプラグインとの衝突を避けるために、テキストプロパティタイプ名は一意である
950986
必要がある。"bufnr" 項目を使用して、バッファに対してローカルにすることもでき

en/popup.txt

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*popup.txt* For Vim version 9.2. Last change: 2026 May 01
1+
*popup.txt* For Vim version 9.2. Last change: 2026 May 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -712,6 +712,15 @@ The second argument of |popup_create()| is a dictionary with options:
712712
when "textprop" is present.
713713
textpropid Used to identify the text property when "textprop" is
714714
present. Use zero to reset.
715+
clipwindow Only used when "textprop" is set. When TRUE the popup
716+
is kept within the window containing the text
717+
property: if the text property scrolls past that
718+
window's top, bottom, left or right edge, the popup
719+
is clipped at that edge instead of being drawn
720+
outside it. Once the text property has scrolled out
721+
of the window the popup is hidden.
722+
Default FALSE.
723+
See |popup-clipwindow|.
715724
fixed When FALSE (the default), and:
716725
- "pos" is "botleft" or "topleft", and
717726
- the popup would be truncated at the right edge of
@@ -949,6 +958,31 @@ If the window for which the popup was defined is closed, the popup is closed.
949958
If the popup cannot fit in the desired position, it may show at a nearby
950959
position.
951960

961+
962+
CLIP TEXTPROP POPUP TO HOST WINDOW *popup-clipwindow*
963+
964+
When the popup is anchored to a text property in a split window, the popup is
965+
by default drawn relative to the whole screen and may extend past the edges of
966+
the window that contains the text property (the "host window"). Setting
967+
"clipwindow" to TRUE keeps the popup within window's content area:
968+
parts of the popup that fall outside the window are clipped, and the popup is
969+
hidden once the text property has scrolled entirely past one of the edges.
970+
971+
Example: a tall popup anchored above the cursor that should never spill into
972+
the window below the split: >
973+
call popup_create(body, #{
974+
\ textprop: 'marker',
975+
\ textpropid: id,
976+
\ pos: 'topleft',
977+
\ line: -1, col: 0,
978+
\ posinvert: v:false,
979+
\ clipwindow: v:true,
980+
\ })
981+
<
982+
With "posinvert" left at its default (TRUE) the popup may be flipped to the
983+
opposite side of the text property when there is no room; set it to FALSE to
984+
keep the requested side and rely on "clipwindow" to clip the overflow.
985+
952986
Some hints:
953987
- To avoid collision with other plugins the text property type name has to be
954988
unique. You can also use the "bufnr" item to make it local to a buffer.

0 commit comments

Comments
 (0)