summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-10-03 11:01:19 +0200
committerChristian Brabandt <cb@256bit.org>2024-10-03 11:01:19 +0200
commita6d9e3c4e07f73f6523699961d8b7b54bdb80cf6 (patch)
treef53fb3ea92d790ca1a6639b11d861d65e6a48f91
parent29822996996550f68a781e85753ebd4d177f22da (diff)
patch 9.1.0756: missing change from patch v9.1.0754v9.1.0756
Problem: missing change from patch v9.1.0754 Solution: use correct width for the actual item in pum_redraw() (glepnir) closes: #15786 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/popupmenu.c2
-rw-r--r--src/testdir/dumps/Test_pum_completeitemalign_07.dump20
-rw-r--r--src/testdir/test_popup.vim16
-rw-r--r--src/version.c2
4 files changed, 38 insertions, 2 deletions
diff --git a/src/popupmenu.c b/src/popupmenu.c
index 010a9872f5..437c6e7e19 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -810,7 +810,7 @@ pum_redraw(void)
if (j == 2
|| (next_isempty && (j == 1 || (j == 0
&& pum_get_item(idx, order[j + 2]) == NULL)))
- || pum_base_width + n >= pum_width)
+ || basic_width + n >= pum_width)
break;
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
diff --git a/src/testdir/dumps/Test_pum_completeitemalign_07.dump b/src/testdir/dumps/Test_pum_completeitemalign_07.dump
new file mode 100644
index 0000000000..3b8acb9ce6
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_completeitemalign_07.dump
@@ -0,0 +1,20 @@
+|l+0&#ffffff0|o@3|n|g|_|f|o@1>
+|m+0#0000001#e0e0e08|e|n|u| |S| |l|o@3
+|m+0&#ffd7ff255|e|n|u| |T| |l|o@3
+|~+0#4040ff13#ffffff0| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+|~| @10
+| +0#0000000&@11
+|-+2&&@1| +0&&@9
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 1758f7498a..a4f6d02d20 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1595,6 +1595,17 @@ func Test_pum_completeitemalign()
\ { 'word': '你好', 'kind': 'C', 'menu': '中文' },
\]}
endfunc
+
+ func Omni_long(findstart, base)
+ if a:findstart
+ return col(".")
+ endif
+ return {
+ \ 'words': [
+ \ { 'word': 'loooong_foo', 'kind': 'S', 'menu': 'menu' },
+ \ { 'word': 'loooong_bar', 'kind': 'T', 'menu': 'menu' },
+ \]}
+ endfunc
set omnifunc=Omni_test
command! -nargs=0 T1 set cia=abbr,kind,menu
command! -nargs=0 T2 set cia=abbr,menu,kind
@@ -1636,8 +1647,11 @@ func Test_pum_completeitemalign()
" T6
call term_sendkeys(buf, ":T6\<CR>S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_completeitemalign_06', {})
- call term_sendkeys(buf, "\<C-E>\<Esc>:T7\<CR>")
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+ call term_sendkeys(buf, ":set columns=12 cmdheight=2 omnifunc=Omni_long\<CR>S\<C-X>\<C-O>")
+ call VerifyScreenDump(buf, 'Test_pum_completeitemalign_07', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>:T7\<CR>")
call StopVimInTerminal(buf)
endfunc
diff --git a/src/version.c b/src/version.c
index 3ea146859c..633c1e6d51 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 756,
+/**/
755,
/**/
754,