Skip to content

Commit 54bab08

Browse files
committed
Update popup.{txt,jax}
1 parent 62a54ed commit 54bab08

2 files changed

Lines changed: 91 additions & 3 deletions

File tree

doc/popup.jax

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*popup.txt* For Vim バージョン 9.2. Last change: 2026 Feb 14
1+
*popup.txt* For Vim バージョン 9.2. Last change: 2026 Feb 18
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -22,8 +22,9 @@
2222
ポップアップフィルタ |popup-filter|
2323
ポップアップコールバック |popup-callback|
2424
ポップアップスクロールバー |popup-scrollbar|
25+
ポップアップの透過度 |popup-opacity|
2526
ポップアップマスク |popup-mask|
26-
3. 例 |popup-examples|
27+
4. 例 |popup-examples|
2728

2829

2930
{|+popupwin| 機能無効でコンパイルされたときは使用できない}
@@ -776,6 +777,13 @@ popup_create() に渡す。
776777
プウィンドウを閉じない。
777778
highlight 'wincolor' オプションに格納されている、テキストに使用
778779
するハイライトグループ名。
780+
opacity ポップアップの透過度。0 から 100 までの値である。
781+
0 は完全に透明 (背景テキストが完全に表示される)。100
782+
は完全に不透明 (デフォルト、不透明)。この間の値を指定
783+
すると、ポップアップの背景と下のテキストがブレンドさ
784+
れ、部分的に透明になる。'termguicolors' を設定する必要
785+
がある。
786+
|popup-opacity| も参照。
779787
padding ポップアップの上/右/下/左のパディングを定義する数値の
780788
リスト(CSSと同様)。空のリストは、すべて 1 のパディング
781789
を使用する。パディングは、テキストをボーダーの内側で囲
@@ -1040,6 +1048,42 @@ Note "x" はポップアップを閉じる通常の方法である。Escを使
10401048
ないように制限されている。
10411049

10421050

1051+
1052+
☆ポップアップの透過度 *popup-opacity*
1053+
1054+
ポップアップウィンドウは、"opacity" オプションを設定することで半透明にすること
1055+
ができる。透過度の値は 0 から 100 の範囲である。
1056+
0 完全に透明 - ポップアップの背景は見えず、ポップアップの背後に
1057+
あるテキストは完全に表示される。
1058+
100 完全に不透明 (デフォルト) - ポップアップは完全に不透明になる。
1059+
1-99 半透明 - ポップアップの背景が下にあるテキストとブレンドされ、
1060+
両方がうっすらと表示される。
1061+
1062+
透明効果を使用するには、GUI を使用するか、ターミナルで 'termguicolors' を有効
1063+
にする必要がある。有効にしない場合、透過度設定は効果がない。
1064+
1065+
ポップアップが透明な場合:
1066+
- ポップアップの背景色は背景のテキストとブレンドされる
1067+
- ポップアップのテキスト (前景) は完全に表示され、ブレンドされない
1068+
- ポップアップの背後のテキストは透明な領域を通して見える
1069+
- ポップアップの透明度が高いほど (不透明度が低いほど)、背景のテキストがよりはっ
1070+
きりと見える
1071+
1072+
これは以下の場合に役立つ:
1073+
- 下のテキストを完全に隠さないオーバーレイウィンドウの作成
1074+
- 画面を遮ることなくコンテキスト情報を表示する
1075+
- 視覚効果とモダンな UI デザインを作成する
1076+
1077+
透過度 50 %の例: >
1078+
let winid = popup_create('Semi-transparent text', #{
1079+
\ line: 5,
1080+
\ col: 10,
1081+
\ opacity: 50,
1082+
\ })
1083+
1084+
透過度は |popup_setoptions()| を使用して動的に変更できる: >
1085+
call popup_setoptions(winid, #{opacity: 80})
1086+
10431087
☆ポップアップマスク *popup-mask*
10441088

10451089
ポップアップがカバーするテキストを最小化するために、その一部を透明にすることが

en/popup.txt

Lines changed: 45 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 Feb 14
1+
*popup.txt* For Vim version 9.2. Last change: 2026 Feb 18
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,6 +21,7 @@ Displaying text in a popup window. *popup* *popup-window* *popupwin*
2121
Popup filter |popup-filter|
2222
Popup callback |popup-callback|
2323
Popup scrollbar |popup-scrollbar|
24+
Popup opacity |popup-opacity|
2425
Popup mask |popup-mask|
2526
4. Examples |popup-examples|
2627

@@ -772,6 +773,13 @@ The second argument of |popup_create()| is a dictionary with options:
772773
the popup window.
773774
highlight Highlight group name to use for the text, stored in
774775
the 'wincolor' option.
776+
opacity Opacity of the popup, a value between 0 and 100:
777+
0 is fully transparent (background text fully visible)
778+
100 is fully opaque (default, no transparency)
779+
Values in between blend the popup background with the
780+
underlying text, making it partially transparent.
781+
Requires 'termguicolors' to be set.
782+
Also see |popup-opacity|.
775783
padding List with numbers, defining the padding
776784
above/right/below/left of the popup (similar to CSS).
777785
An empty list uses a padding of 1 all around. The
@@ -1046,6 +1054,42 @@ A click in the lower half will scroll the text up one line. However, this is
10461054
limited so that the popup does not get smaller.
10471055

10481056

1057+
1058+
POPUP OPACITY *popup-opacity*
1059+
1060+
A popup window can be made semi-transparent by setting the "opacity" option.
1061+
The opacity value ranges from 0 to 100:
1062+
0 Fully transparent - the popup background is invisible and the
1063+
text behind the popup is fully visible.
1064+
100 Fully opaque (default) - the popup is not transparent at all.
1065+
1-99 Partially transparent - the popup background is blended with
1066+
the underlying text, making both partially visible.
1067+
1068+
The transparency effect requires using the GUI or having 'termguicolors'
1069+
enabled in the terminal. Without it, the opacity setting has no effect.
1070+
1071+
When a popup is transparent:
1072+
- The popup's background color is blended with the background text
1073+
- The popup's text (foreground) remains fully visible and unblended
1074+
- Text behind the popup is visible through transparent areas
1075+
- The more transparent the popup (lower opacity), the more clearly the
1076+
background text can be seen
1077+
1078+
This can be useful for:
1079+
- Creating overlay windows that don't completely obscure underlying text
1080+
- Showing contextual information without blocking the view
1081+
- Creating visual effects and modern UI designs
1082+
1083+
Example with 50% opacity: >
1084+
let winid = popup_create('Semi-transparent text', #{
1085+
\ line: 5,
1086+
\ col: 10,
1087+
\ opacity: 50,
1088+
\ })
1089+
1090+
The opacity can be changed dynamically using |popup_setoptions()|: >
1091+
call popup_setoptions(winid, #{opacity: 80})
1092+
10491093
POPUP MASK *popup-mask*
10501094

10511095
To minimize the text that the popup covers, parts of it can be made

0 commit comments

Comments
 (0)