Skip to content

Commit 317351c

Browse files
mattnchrisbra
authored andcommitted
patch 9.2.0318: cannot configure opacity for popup menu
Problem: cannot configure opacity for popup menu Solution: Add the 'pumopt' option, consolidate existing pum options into the pumopt option (Yasuhiro Matsumoto) closes: #19931 Signed-off-by: Yasuhiro Matsumoto <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent f3cba4a commit 317351c

22 files changed

Lines changed: 714 additions & 98 deletions

runtime/doc/options.txt

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.2. Last change: 2026 Apr 06
1+
*options.txt* For Vim version 9.2. Last change: 2026 Apr 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -6886,6 +6886,7 @@ A jump table for the options with a short description can be found at |Q_op|.
68866886
global
68876887
Defines a border and optional decorations for the popup menu in
68886888
completion. The value is a comma-separated list of keywords.
6889+
See |'pumopt'| for a consolidated alternative.
68896890

68906891
Border styles (at most one):
68916892
"single" use thin box-drawing characters
@@ -6921,6 +6922,7 @@ A jump table for the options with a short description can be found at |Q_op|.
69216922
Determines the maximum number of items to show in the popup menu for
69226923
Insert mode completion. When zero as much space as available is used.
69236924
|ins-completion-menu|.
6925+
See |'pumopt'| for a consolidated alternative.
69246926

69256927
*'pummaxwidth'* *'pmw'*
69266928
'pummaxwidth' 'pmw' number (default 0)
@@ -6932,12 +6934,67 @@ A jump table for the options with a short description can be found at |Q_op|.
69326934

69336935
This option takes precedence over 'pumwidth'.
69346936
|ins-completion-menu|.
6937+
See |'pumopt'| for a consolidated alternative.
6938+
6939+
*'pumopt'*
6940+
'pumopt' string (default "")
6941+
global
6942+
Configures the popup menu used for Insert mode completion.
6943+
The value is a comma-separated list of key:value pairs and flags.
6944+
6945+
Keys with values:
6946+
border:{style} set a border style (at most one):
6947+
"single" thin box-drawing characters
6948+
"double" double-line box-drawing characters
6949+
"round" rounded corners
6950+
"ascii" ASCII characters (-, |, +)
6951+
"custom:X;X;X;X;X;X;X;X"
6952+
eight characters separated by
6953+
semicolons, in the order: top, right,
6954+
bottom, left, topleft, topright,
6955+
botright, botleft
6956+
height:{n} maximum number of items to show (default 0,
6957+
meaning as much space as available)
6958+
width:{n} minimum width (default 15)
6959+
maxwidth:{n} maximum width (default 0, meaning no limit).
6960+
This takes precedence over width.
6961+
Truncated text is indicated by "trunc" value
6962+
of 'fillchars' option.
6963+
opacity:{n} opacity percentage 0-100 (default 100).
6964+
When less than 100, background content shows
6965+
through the popup menu.
6966+
6967+
Flags (no value):
6968+
margin adds one-cell spacing inside the left and
6969+
right border. Requires a border style.
6970+
shadow draws a shadow at the right and bottom edges.
6971+
6972+
Border styles using box-drawing characters ("single", "double",
6973+
"round") are only available when 'encoding' is "utf-8" and
6974+
'ambiwidth' is "single".
6975+
6976+
Highlight groups:
6977+
|hl-PmenuBorder| used for the border characters
6978+
|hl-PmenuShadow| used for the shadow
6979+
6980+
Note: When 'pumopt' is set, all values are reset to their defaults
6981+
first, then the specified keys are applied. Unspecified keys get
6982+
their default values.
6983+
6984+
Examples: >
6985+
:set pumopt=border:single
6986+
:set pumopt=border:double,margin,shadow
6987+
:set pumopt=height:10,width:20,opacity:80
6988+
:set pumopt=border:custom:─;│;─;│;┌;┐;┘;└,shadow
6989+
<
6990+
See also: |ins-completion-menu|.
69356991

69366992
*'pumwidth'* *'pw'*
69376993
'pumwidth' 'pw' number (default 15)
69386994
global
69396995
Determines the minimum width to use for the popup menu for Insert mode
69406996
completion. |ins-completion-menu|.
6997+
See |'pumopt'| for a consolidated alternative.
69416998

69426999
*'pythondll'*
69437000
'pythondll' string (default depends on the build)

runtime/doc/quickref.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickref.txt* For Vim version 9.2. Last change: 2026 Mar 04
1+
*quickref.txt* For Vim version 9.2. Last change: 2026 Apr 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -865,6 +865,7 @@ Short explanation of each option: *option-list*
865865
'printoptions' 'popt' controls the format of :hardcopy output
866866
'prompt' 'prompt' enable prompt in Ex mode
867867
'pumheight' 'ph' maximum height of the popup menu
868+
'pumopt' 'pumopt' additional options for the popup menu
868869
'pumwidth' 'pw' minimum width of the popup menu
869870
'pythondll' name of the Python 2 dynamic library
870871
'pythonhome' name of the Python 2 home directory

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ $quote eval.txt /*$quote*
891891
'pumborder' options.txt /*'pumborder'*
892892
'pumheight' options.txt /*'pumheight'*
893893
'pummaxwidth' options.txt /*'pummaxwidth'*
894+
'pumopt' options.txt /*'pumopt'*
894895
'pumwidth' options.txt /*'pumwidth'*
895896
'pvh' options.txt /*'pvh'*
896897
'pvp' options.txt /*'pvp'*

runtime/doc/version9.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*version9.txt* For Vim version 9.2. Last change: 2026 Mar 25
1+
*version9.txt* For Vim version 9.2. Last change: 2026 Apr 07
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -52641,6 +52641,7 @@ Autocommands: ~
5264152641

5264252642
Options: ~
5264352643

52644+
'pumopt' Additional options for the popup menu
5264452645
'statuslineopt' Extra window-local options for the 'statusline', to
5264552646
configure the height.
5264652647
't_BS' Begin synchronized update.

runtime/optwin.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" These commands create the option window.
22
"
33
" Maintainer: The Vim Project <https://github.com/vim/vim>
4-
" Last Change: 2026 Mar 11
4+
" Last Change: 2026 Apr 07
55
" Former Maintainer: Bram Moolenaar <[email protected]>
66

77
" If there already is an option window, jump to that one.
@@ -913,6 +913,8 @@ if has("insert_expand")
913913
call <SID>OptionG("pmw", &pmw)
914914
call <SID>AddOption("pumborder", gettext("popup border style"))
915915
call <SID>OptionG("pb", &pb)
916+
call <SID>AddOption("pumopt", gettext("additional options for the popup menu"))
917+
call <SID>OptionG("pumopt", &pumopt)
916918
call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))
917919
call append("$", "\t" .. s:local_to_buffer)
918920
call <SID>OptionL("cfu")

0 commit comments

Comments
 (0)