diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-03-28 15:37:49 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-29 21:12:32 +0800 |
commit | 62da4e2949cc906102bd768cdd40b274623822b6 (patch) | |
tree | f81120d9e4b80abd16b3ceb6c46149b550b5be18 /runtime | |
parent | 89bc9455543abbd98bba752367ab5f2b83943931 (diff) | |
download | rneovim-62da4e2949cc906102bd768cdd40b274623822b6.tar.gz rneovim-62da4e2949cc906102bd768cdd40b274623822b6.tar.bz2 rneovim-62da4e2949cc906102bd768cdd40b274623822b6.zip |
vim-patch:9.1.1250: cannot set the maximum popup menu width
Problem: cannot set the maximum popup menu width
(Lucas Mior)
Solution: add the new global option value 'pummaxwidth'
(glepnir)
fixes: vim/vim#10901
closes: vim/vim#16943
https://github.com/vim/vim/commit/88d75934c3d5bc4c406343f106e1a61638abd3a7
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/news.txt | 1 | ||||
-rw-r--r-- | runtime/doc/options.txt | 8 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 11 | ||||
-rw-r--r-- | runtime/optwin.vim | 4 |
4 files changed, 23 insertions, 1 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index aa6af1ef55..5f47c474a7 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -79,6 +79,7 @@ LUA OPTIONS • 'diffopt' `inline:` configures diff highlighting for changes within a line. +• 'pummaxwidth' sets maximum width for the completion popup menu. PLUGINS diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index ada4e250bc..bdc4f20fac 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4623,6 +4623,14 @@ A jump table for the options with a short description can be found at |Q_op|. Maximum number of items to show in the popup menu (|ins-completion-menu|). Zero means "use available screen space". + *'pummaxwidth'* *'pmw'* +'pummaxwidth' 'pmw' number (default 0) + global + Maximum width for the popup menu (|ins-completion-menu|). When zero, + there is no maximum width limit, otherwise the popup menu will never be + wider than this value. Truncated text will be indicated by "..." at the + end. Takes precedence over 'pumwidth'. + *'pumwidth'* *'pw'* 'pumwidth' 'pw' number (default 15) global diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 5f93e42c35..9ff4770e7c 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -4802,6 +4802,17 @@ vim.o.ph = vim.o.pumheight vim.go.pumheight = vim.o.pumheight vim.go.ph = vim.go.pumheight +--- Maximum width for the popup menu (`ins-completion-menu`). When zero, +--- there is no maximum width limit, otherwise the popup menu will never be +--- wider than this value. Truncated text will be indicated by "..." at the +--- end. Takes precedence over 'pumwidth'. +--- +--- @type integer +vim.o.pummaxwidth = 0 +vim.o.pmw = vim.o.pummaxwidth +vim.go.pummaxwidth = vim.o.pummaxwidth +vim.go.pmw = vim.go.pummaxwidth + --- Minimum width for the popup menu (`ins-completion-menu`). If the --- cursor column + 'pumwidth' exceeds screen width, the popup menu is --- nudged to fit on the screen. diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 56fbb954a7..41f9fc0373 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2025 Mar 07 +" Last Change: 2025 Mar 27 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " If there already is an option window, jump to that one. @@ -736,6 +736,8 @@ if has("insert_expand") call <SID>OptionG("ph", &ph) call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu")) call <SID>OptionG("pw", &pw) + call <SID>AddOption("pumaxmwidth", gettext("maximum width of the popup menu")) + call <SID>OptionG("pmw", &pmw) call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion")) call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("cfu") |